40 lines
1.8 KiB
JavaScript
40 lines
1.8 KiB
JavaScript
import { readFileSync } from "node:fs";
|
|
|
|
const page = readFileSync(new URL("../src/features/dataflow/DataflowPage.tsx", import.meta.url), "utf8");
|
|
const canvas = readFileSync(new URL("../src/features/dataflow/DataflowCanvas.tsx", import.meta.url), "utf8");
|
|
const css = readFileSync(new URL("../src/styles/dataflow.css", import.meta.url), "utf8");
|
|
const moduleEntry = readFileSync(new URL("../src/module.ts", import.meta.url), "utf8");
|
|
|
|
const checks = [
|
|
[page.includes("<DataflowCanvas"), "graph canvas"],
|
|
[page.includes("Apply SQL"), "SQL workbench"],
|
|
[page.includes("<NodeInspector"), "node inspector"],
|
|
[page.includes("previewDataflowPipeline"), "preview action"],
|
|
[page.includes("useUnsavedDraftGuard"), "unsaved-change guard"],
|
|
[canvas.includes("application/x-govoplan-dataflow-node"), "palette drop handling"],
|
|
[canvas.includes("isValidConnection"), "edge validation"],
|
|
[canvas.includes("connectionRadius={32}"), "visible connection drop radius"],
|
|
[
|
|
moduleEntry.indexOf("@xyflow/react/dist/style.css") <
|
|
moduleEntry.indexOf("./styles/dataflow.css"),
|
|
"XyFlow base styles before GovOPlaN overrides"
|
|
],
|
|
[css.includes("height: calc(100vh - 115px)"), "full-height workspace"],
|
|
[css.includes(".dataflow-preview-table-wrap"), "bounded preview scrolling"],
|
|
[
|
|
/\.dataflow-palette-items\s*\{[^}]*grid-auto-rows:\s*max-content;[^}]*overflow-y:\s*auto;/s.test(css),
|
|
"bounded palette scrolling"
|
|
],
|
|
[
|
|
/\.dataflow-inspector-fields\s*\{[^}]*grid-auto-rows:\s*max-content;[^}]*overflow-y:\s*auto;/s.test(css),
|
|
"bounded inspector scrolling"
|
|
]
|
|
];
|
|
|
|
const missing = checks.filter(([present]) => !present).map(([, label]) => label);
|
|
if (missing.length) {
|
|
throw new Error(`Dataflow UI structure is missing: ${missing.join(", ")}`);
|
|
}
|
|
|
|
console.log("Dataflow page structure checks passed.");
|