Files
fusion/packages/dashboard/app/components/__tests__/SettingsModal.backup.css.test.ts
gsxdsm f58fb8955a fix(engine-tests): eliminate temp-dir leak and raise subprocess guard for concurrent workspace runs
Two engine merger tests created mkdtempSync workspaces directly in tmpdir()
under the tracked `fusion-test-` prefix; under full-suite concurrent load
the post-run check-test-isolation flagged them as leaks. Route both
(`merger-no-op-fix-finalize.test.ts`, `merger-verification-fix-already-on-main.test.ts`)
through FUSION_TEST_WORKER_ROOT like sibling merger tests so they nest
inside the already-tracked worker root.

Bump engine vitest subprocess guard from 60s to 120s and testTimeout to
30s — plain git commands (branch -d, worktree remove) queued behind
system contention during `pnpm -r --workspace-concurrency=2` runs were
timing out. The guard only fires on hangs, so healthy tests pay nothing.

Also bundles in-progress dashboard mobile-breakpoint regex/CSS test
updates and docs index additions.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-22 20:20:42 -07:00

35 lines
1.6 KiB
TypeScript

import { describe, expect, it } from "vitest";
import { loadAllAppCss } from "../../test/cssFixture";
describe("SettingsModal backup CSS contract", () => {
it("defines themed backup section selectors with tokenized styles", async () => {
const css = await loadAllAppCss();
expect(css).toMatch(/\.backup-stats\s*\{[\s\S]*?\}/);
expect(css).toMatch(/\.backup-stat\s*\{[\s\S]*?\}/);
expect(css).toMatch(/\.backup-stat-value\s*\{[\s\S]*?\}/);
expect(css).toMatch(/\.backup-stat-label\s*\{[\s\S]*?\}/);
expect(css).toMatch(/\.backup-list\s*\{[\s\S]*?\}/);
expect(css).toMatch(/\.backup-list ul\s*\{[\s\S]*?\}/);
expect(css).toMatch(/\.backup-list li\s*\{[\s\S]*?\}/);
expect(css).toMatch(/\.backup-size\s*\{[\s\S]*?\}/);
const backupBlock = (css.match(/\/\* === Settings Backups:[\s\S]*?\.settings-layout\s*\{/)?.[0] ?? "");
expect(backupBlock).toContain("var(--space-");
expect(backupBlock).toContain("var(--text");
expect(backupBlock).toContain("var(--border");
expect(backupBlock).toContain("var(--surface");
expect(backupBlock).toContain("var(--font-mono");
expect(backupBlock).toContain("var(--radius-");
expect(backupBlock).toContain("color-mix(");
expect(backupBlock).not.toMatch(/#[0-9a-fA-F]{3,8}\b/);
expect(backupBlock).not.toContain("rgba(");
});
it("keeps mobile backup list scroll behavior", async () => {
const css = await loadAllAppCss();
expect(css).toMatch(/@media[^{]*\(max-width:\s*768px\)[^{]*\{[\s\S]*?\.backup-list ul\s*\{[^}]*max-height\s*:[^;]+;[^}]*overflow-y\s*:\s*auto;[^}]*-webkit-overflow-scrolling\s*:\s*touch;[^}]*\}/);
});
});