mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2026-10-31 13:28:18 +00:00
fix(syncguard): retire bypass on catch-up completion and close CSS rule
This commit is contained in:
1 parent
2d3a5e5ff8
commit
47828e934b
6 files changed
+100
-4
No files matched your search
@@ -0,0 +1,18 @@
|
||||
import { readFileSync } from "node:fs";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
const stylesheet = readFileSync(fileURLToPath(new URL("../styles.css", import.meta.url)), "utf8");
|
||||
|
||||
describe("SyncGuard CSS", () => {
|
||||
it("closes its bypass rule before the existing status display rules", () => {
|
||||
const bypassStart = stylesheet.indexOf(".sls-sync-guard-bypass {");
|
||||
const statusStart = stylesheet.indexOf(".livesync-stat-item {", bypassStart);
|
||||
expect(bypassStart).toBeGreaterThanOrEqual(0);
|
||||
expect(statusStart).toBeGreaterThan(bypassStart);
|
||||
const bypassRule = stylesheet.slice(bypassStart, statusStart);
|
||||
expect(bypassRule).toMatch(/min-height:\s*44px;/);
|
||||
expect(bypassRule).toMatch(/min-width:\s*44px;/);
|
||||
expect(bypassRule).toMatch(/}\s*$/);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user