import { readFileSync } from "node:fs"; import { join } from "node:path"; const statusTones = ["neutral", "info", "success", "warning", "danger"] as const; describe("semantic status language", () => { it("defines the complete semantic token set", () => { const styles = readFileSync(join(process.cwd(), "src/styles.css"), "utf8"); statusTones.forEach((tone) => { expect(styles).toContain(`--status-${tone}-soft:`); expect(styles).toContain(`--status-${tone}-border:`); expect(styles).toContain(`--status-${tone}-foreground:`); expect(styles).toContain(`--status-${tone}-mark:`); expect(styles).toContain(`.status-tone-${tone}`); }); }); it("stops shared status motion when reduced motion is requested", () => { const styles = readFileSync(join(process.cwd(), "src/styles.css"), "utf8"); expect(styles).toMatch( /@media \(prefers-reduced-motion: reduce\)[\s\S]*?\.status-dot\[data-activity="live"\][\s\S]*?animation:\s*none/ ); }); it("does not derive Agent connection styling from localized copy", () => { const agentHook = readFileSync( join(process.cwd(), "src/features/workbench/hooks/use-workbench-agent.ts"), "utf8" ); const agentPanel = readFileSync( join(process.cwd(), "src/features/agent/components/agent-command-panel.tsx"), "utf8" ); expect(agentPanel).not.toMatch(/statusLabel\.(?:includes|match|startsWith)/); expect(agentPanel).not.toContain("getAgentConnection"); expect(agentHook).not.toContain("runtimeAvailability"); expect(agentPanel).toContain("AgentConnectionStatus"); }); });