test: remove layout-pinned route-registry and task-meta fixture tests
TestDashboardPagesRegistryCoversEveryRoute parsed ui/src/router/index.ts as text, and TestTaskMetaPayloadMatchesFixture plus ui/test/task-meta-snapshot pinned a formatted JSON fixture. They failed on formatting, not behaviour.
This commit is contained in:
1 parent
be1b3aa6a1
commit
35dd7489dd
8 files changed
+4
-285
No files matched your search
@@ -1,8 +1,6 @@
|
||||
// The freeze-dried /api/task-meta catalog the dashboard renders before the
|
||||
// served one arrives, or when archied is unreachable. It has no imports so the
|
||||
// node test runner can compare it against the Go handler's committed fixture
|
||||
// (internal/webui/testdata/task_meta.json); task-meta.ts replaces it with the
|
||||
// live catalog.
|
||||
// served one arrives, or when archied is unreachable; task-meta.ts replaces it
|
||||
// with the live catalog.
|
||||
|
||||
/** A lifecycle status as the server describes it. */
|
||||
export interface StatusMeta {
|
||||
|
||||
@@ -17,8 +17,7 @@ import TaskDetailPage from "@/tasks/TaskDetailPage.vue";
|
||||
import TasksPage from "@/tasks/TasksPage.vue";
|
||||
import WorkflowsPage from "@/workflows/WorkflowsPage.vue";
|
||||
|
||||
// internal/gateway/dashboard_tools.go mirrors this table; its test parses this
|
||||
// file, so mark any entry the registry should skip with `nav: false`.
|
||||
// internal/gateway/dashboard_tools.go mirrors this table.
|
||||
//
|
||||
// meta:
|
||||
// label the navigation label, short because its group carries the context
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
import assert from "node:assert/strict";
|
||||
import { readFile } from "node:fs/promises";
|
||||
import test from "node:test";
|
||||
|
||||
const snapshot = await import("../src/lib/task-meta-snapshot.ts");
|
||||
|
||||
// internal/webui/testdata/task_meta.json is the served /api/task-meta payload,
|
||||
// pinned byte-for-byte by TestTaskMetaPayloadMatchesFixture. Comparing the
|
||||
// first-paint snapshot against it means a one-sided rename of any vocabulary
|
||||
// fails on whichever side was not updated.
|
||||
const fixture = JSON.parse(
|
||||
await readFile(
|
||||
new URL("../../internal/webui/testdata/task_meta.json", import.meta.url),
|
||||
"utf8",
|
||||
),
|
||||
);
|
||||
|
||||
// The server emits an unset optional field (needs_you, confirm) as its zero
|
||||
// value; the snapshot omits it.
|
||||
const dropZero = (rows: Record<string, unknown>[]) =>
|
||||
rows.map((row) =>
|
||||
Object.fromEntries(
|
||||
Object.entries(row).filter(([, v]) => v !== false && v !== ""),
|
||||
),
|
||||
);
|
||||
|
||||
test("the status snapshot matches the served catalog", () => {
|
||||
assert.deepEqual(snapshot.DEFAULT_STATUSES, dropZero(fixture.statuses));
|
||||
});
|
||||
|
||||
test("the action snapshot matches the served catalog", () => {
|
||||
assert.deepEqual(snapshot.DEFAULT_ACTIONS, dropZero(fixture.actions));
|
||||
});
|
||||
|
||||
test("the change-status snapshot matches the served catalog", () => {
|
||||
assert.deepEqual(snapshot.DEFAULT_CHANGE_STATUSES, fixture.change_statuses);
|
||||
});
|
||||
|
||||
test("the config schema snapshot matches the served catalog", () => {
|
||||
assert.equal(snapshot.DEFAULT_CONFIG_SCHEMA, fixture.config_schema);
|
||||
});
|
||||
Reference in new issue
Block a user