feat(data): add read-only artifact health monitor
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
import assert from "node:assert/strict";
|
||||
import { readFile } from "node:fs/promises";
|
||||
import { test } from "node:test";
|
||||
|
||||
const sourceRoot = new URL("../src/", import.meta.url);
|
||||
|
||||
async function read(relativePath) {
|
||||
return readFile(new URL(relativePath, sourceRoot), "utf8");
|
||||
}
|
||||
|
||||
test("artifact health remains a bounded read-only data feature", async () => {
|
||||
const [
|
||||
productModel,
|
||||
workspaceHub,
|
||||
core,
|
||||
workspace,
|
||||
featureStyles,
|
||||
styles,
|
||||
] = await Promise.all([
|
||||
read("productModel.ts"),
|
||||
read("workspaces/Workspaces.tsx"),
|
||||
read("core/data/artifactHealth.ts"),
|
||||
read("workspaces/data/ArtifactHealthWorkspace.tsx"),
|
||||
read("styles/artifact-health.css"),
|
||||
read("styles.css"),
|
||||
]);
|
||||
|
||||
assert.match(productModel, /kind: "artifact-health"/);
|
||||
assert.match(workspaceHub, /<ArtifactHealthWorkspace \/>/);
|
||||
assert.match(core, /\/api\/v1\/data\/artifact-health/);
|
||||
assert.doesNotMatch(core, /@nodedc\/ui-react/);
|
||||
assert.match(workspace, /fetchArtifactHealth/);
|
||||
assert.match(workspace, /POLL_MILLISECONDS\s*=\s*30_000/);
|
||||
assert.doesNotMatch(workspace, /delete|deduplicat|migration.*fetch/i);
|
||||
assert.doesNotMatch(
|
||||
featureStyles,
|
||||
/\bborder:\s*1px\s+solid/,
|
||||
"Artifact health must not add decorative perimeter outlines",
|
||||
);
|
||||
assert.match(styles, /artifact-health\.css/);
|
||||
});
|
||||
Reference in New Issue
Block a user