Files
fusion/packages/dashboard/app/components/__tests__/GoalsView.css.test.ts
Fusion (runfusion.ai) b94eae4f23 feat(FN-4719): complete Step 3-4 — goals view lazy wiring and changeset
Fusion-Task-Id: FN-4719
Fusion-Task-Lineage: 53fb716e-2d3e-40c7-ad7a-e9f315f33c34
2026-05-16 05:29:27 -07:00

21 lines
740 B
TypeScript

import { describe, expect, it } from "vitest";
import { loadAllAppCss } from "../../test/cssFixture";
function goalsBlocks(css: string): string {
const blocks = css.match(/[^\n]*\.goals-[^{\n]*\{[^}]*\}/gms) ?? [];
return blocks.join("\n");
}
describe("GoalsView CSS token guardrails", () => {
it("uses tokens and contains mobile/focus rules", async () => {
const css = await loadAllAppCss();
const goalsCss = goalsBlocks(css);
expect(goalsCss).not.toMatch(/#[0-9a-fA-F]{3,8}/g);
expect(goalsCss).not.toMatch(/rgba?\(/g);
expect(goalsCss).not.toMatch(/\b[1-9]\d*px\b/g);
expect(css).toMatch(/\.goals-[^\n{]*:focus-visible/g);
expect(css).toMatch(/@media \(max-width: 768px\)[\s\S]*\.goals-/);
});
});