Files
EpicNext-Cms/src/features/housekeeping/cutover/parity.test.ts
T
Simo 8a31556d51
CI / check (pull_request) Successful in 1m9s
CI / release (pull_request) Skipped
CI / deploy (pull_request) Skipped
test(housekeeping): prove 137 route parity
2026-08-30 19:11:14 +02:00

48 lines
1.6 KiB
TypeScript

import { describe, expect, it } from "vitest";
import { createHousekeepingRegistry } from "../foundation/registry";
import { HOUSEKEEPING_MANIFESTS } from "../manifests";
import { discoverLegacyPages } from "../migration/discover-legacy-pages";
import { HOUSEKEEPING_MIGRATION_MATRIX } from "../migration/matrix";
import { HOUSEKEEPING_ROUTE_HANDLERS } from "../route-handlers";
import { verifyHousekeepingRuntimeParity } from "./parity";
describe("Housekeeping runtime parity", () => {
const report = verifyHousekeepingRuntimeParity(
HOUSEKEEPING_MIGRATION_MATRIX,
createHousekeepingRegistry(HOUSEKEEPING_MANIFESTS),
HOUSEKEEPING_ROUTE_HANDLERS,
);
it("closes all 137 discovered migration rows against the runtime", () => {
expect(discoverLegacyPages()).toHaveLength(137);
expect(report).toEqual({
discovered: 137,
mapped: 137,
verified: 137,
removed: 2,
unresolved: [],
capabilityGaps: [],
handlerGaps: [],
});
});
it("keeps every retained target under /ase with concrete parity evidence", () => {
for (const row of HOUSEKEEPING_MIGRATION_MATRIX) {
if (row.decision === "REMOVE") {
expect(row.targetPath, row.legacyPath).toBeNull();
expect(row.status, row.legacyPath).toBe("REMOVED");
expect(row.parityEvidence, row.legacyPath).toContain(
`runtime-parity:${row.legacyPath}`,
);
continue;
}
expect(row.targetPath, row.legacyPath).toMatch(/^\/ase(?:\/|$)/);
expect(row.status, row.legacyPath).toBe("VERIFIED");
expect(row.parityEvidence, row.legacyPath).toContain(
`runtime-parity:${row.legacyPath}`,
);
}
});
});