Adopt the shared interface pattern language
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import assert from "node:assert/strict";
|
||||
import fs from "node:fs";
|
||||
|
||||
const page = fs.readFileSync("src/features/projects/ProjectsPage.tsx", "utf8");
|
||||
const styles = fs.readFileSync("src/styles/projects.css", "utf8");
|
||||
|
||||
assert.ok(page.includes("DocumentationHelpLink"), "Projects exposes configured-system help");
|
||||
assert.ok(page.includes("PageScrollViewport"), "Projects owns bounded list and detail scrolling");
|
||||
assert.ok(page.includes("<Dialog"), "Projects uses the shared focus-contained editor dialog");
|
||||
assert.ok(page.includes("FieldLabel"), "Project editor fields use the shared label/help contract");
|
||||
assert.ok(page.includes('DismissibleAlert tone="danger" resetKey={error}'), "Save failures remain attached to the editor");
|
||||
assert.ok(page.includes("StatusBadge"), "Project lifecycle state is not conveyed by color alone");
|
||||
assert.ok(!page.includes("window.alert("), "Projects must not use browser alerts");
|
||||
assert.ok(!/<(div|span|li|tr)\b[^>]*\bonClick\s*=/.test(page), "Projects uses semantic interactive elements");
|
||||
assert.ok(styles.includes("@media (max-width: 560px)"), "Projects retains a narrow-viewport editor layout");
|
||||
assert.ok(styles.includes(":focus-visible"), "Projects retains visible keyboard focus");
|
||||
|
||||
console.log("Projects interface pattern contract passed.");
|
||||
Reference in New Issue
Block a user