The detail path /examples/reference-resources/:resourceId lost to the static new and status routes, so an item with one of those ids opened the wrong screen. The breaking route change carries registry evidence. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
25 lines
1.2 KiB
TypeScript
25 lines
1.2 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
|
|
import { TEMPLATE_APP_MODULE } from "../../../src/apps/template-app.ts";
|
|
import { createAppRouteModules } from "../../../src/platform/routing/context-route-module.ts";
|
|
|
|
describe("installed context routing", () => {
|
|
it("boots one bounded-context entry instead of flattening feature routes", () => {
|
|
const modules = createAppRouteModules(TEMPLATE_APP_MODULE);
|
|
expect(modules.map((module) => module.id)).toEqual(["reference-context"]);
|
|
expect(modules.some((module) => module.id === "REFERENCE_RESOURCE_LIST")).toBe(false);
|
|
});
|
|
|
|
it("loads the reference feature routes lazily without changing public URLs", async () => {
|
|
const [context] = createAppRouteModules(TEMPLATE_APP_MODULE);
|
|
expect(context).toBeDefined();
|
|
const routes = await context!.loadRoutes();
|
|
expect(routes.map((route) => [route.id, route.path])).toEqual([
|
|
["REFERENCE_RESOURCE_LIST", "/examples/reference-resources"],
|
|
["REFERENCE_RESOURCE_DETAIL", "/examples/reference-resources/items/:resourceId"],
|
|
["REFERENCE_RESOURCE_FORM", "/examples/reference-resources/new"],
|
|
["REFERENCE_RESOURCE_STATUS", "/examples/reference-resources/status"],
|
|
]);
|
|
});
|
|
});
|