fix(syncguard): retire bypass on catch-up completion and close CSS rule

This commit is contained in:
Artem Ovchinnikov committed 2026-10-29 12:56:01 +03:00
1 parent 2d3a5e5ff8
commit 47828e934b
6 files changed
+100 -4

No files matched your search

+18
View File
@@ -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*$/);
});
});