import { readFileSync } from "node:fs"; import { resolve } from "node:path"; import { describe, expect, test } from "vitest"; const sourceRoot = resolve(__dirname); describe("Recent runs success styling contract", () => { test("every history renderer exposes its run status to the shared styles", () => { const renderers = [ "DescriptionGenerationDrawer.tsx", "SensitiveDataSuggestionHistoryDrawer.tsx", "CatalogSyncDrawer.tsx", ]; for (const renderer of renderers) { const source = readFileSync(resolve(sourceRoot, renderer), "utf8"); expect(source, renderer).toMatch(/data-status=\{item\.(?:status|state)\}/); } }); test("shared history styles cover both successful status vocabularies", () => { const styles = readFileSync(resolve(sourceRoot, "FleetLedgerShell.css"), "utf8"); expect(styles).toContain('button[data-status="completed"]'); expect(styles).toContain('button[data-status="succeeded"]'); expect(styles).toMatch(/oklch\(var\(--success\)/); }); });