feat(housekeeping): dispatch canonical domain routes
This commit is contained in:
1 parent
2970dff563
commit
e5c230ba35
13 files changed
+680
-82
No files matched your search
@@ -0,0 +1,20 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { createHousekeepingRegistry } from "./foundation/registry";
|
||||
import { HOUSEKEEPING_MANIFESTS } from "./manifests";
|
||||
import { HOUSEKEEPING_ROUTE_HANDLERS } from "./route-handlers";
|
||||
|
||||
describe("housekeeping route handlers", () => {
|
||||
it("has exactly one handler for every registered route and no placeholders", () => {
|
||||
const registry = createHousekeepingRegistry(HOUSEKEEPING_MANIFESTS);
|
||||
const routeIds = registry.domains.flatMap((domain) =>
|
||||
domain.routes.map((route) => route.id),
|
||||
);
|
||||
const handlerIds = HOUSEKEEPING_ROUTE_HANDLERS.map(
|
||||
(handler) => handler.routeId,
|
||||
);
|
||||
|
||||
expect(new Set(handlerIds).size).toBe(handlerIds.length);
|
||||
expect([...handlerIds].sort()).toEqual([...routeIds].sort());
|
||||
expect(handlerIds).toEqual([]);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user