Files
govoplan-tickets/webui/scripts/test-interface-pattern.mjs
T

24 lines
1.7 KiB
JavaScript

import assert from "node:assert/strict";
import fs from "node:fs";
const page = fs.readFileSync("src/features/tickets/TicketsPage.tsx", "utf8");
const styles = fs.readFileSync("src/styles/tickets.css", "utf8");
assert.ok(page.includes("WorkspaceActionBar"), "Tickets uses the semantic shared action bar");
assert.ok(page.includes("refreshable"), "The refreshable Tickets workspace exposes Reload");
assert.ok(page.includes("DocumentationHelpLink"), "Tickets exposes contextual documentation");
assert.ok(page.includes("PageScrollViewport"), "Tickets owns bounded queue and detail scrolling");
assert.ok(page.includes("<Dialog"), "Ticket mutations use shared focus-contained dialogs");
assert.ok(page.includes("FieldLabel"), "Ticket fields use the shared label and help contract");
assert.ok(page.includes("StatusBadge"), "Ticket state is not conveyed by color alone");
assert.ok(page.includes("listTicketHistory"), "The workspace projects immutable ticket history");
assert.ok(page.includes("ParticipantsDialog"), "Participants use a governed shared dialog");
assert.ok(page.includes("LinkDialog"), "References and attachments use a governed shared dialog");
assert.ok(page.includes("<ConfirmDialog"), "Administrative deletion is separately confirmed");
assert.ok(page.includes("ticket-destructive-actions"), "Destructive ticket actions are visually separated");
assert.ok(!page.includes("window.alert("), "Tickets must not use browser alerts");
assert.ok(!/<(div|span|li|tr)\b[^>]*\bonClick\s*=/.test(page), "Tickets uses semantic interactive elements");
assert.ok(styles.includes("@media (max-width: 760px)"), "Tickets retains a responsive queue-detail layout");
console.log("Tickets interface pattern contract passed.");