()
| 17 | }; |
| 18 | |
| 19 | const make = (): SpikeRouter => { |
| 20 | const rootRoute = createRootRoute(); |
| 21 | const orgScope = createRoute({ |
| 22 | getParentRoute: () => rootRoute, |
| 23 | path: "/{-$orgSlug}", |
| 24 | }); |
| 25 | const indexRoute = createRoute({ getParentRoute: () => orgScope, path: "/" }); |
| 26 | const policiesRoute = createRoute({ getParentRoute: () => orgScope, path: "/policies" }); |
| 27 | const nsRoute = createRoute({ |
| 28 | getParentRoute: () => orgScope, |
| 29 | path: "/integrations/$namespace", |
| 30 | }); |
| 31 | const loginRoute = createRoute({ getParentRoute: () => rootRoute, path: "/login" }); |
| 32 | const routeTree = rootRoute.addChildren([ |
| 33 | orgScope.addChildren([indexRoute, policiesRoute, nsRoute]), |
| 34 | loginRoute, |
| 35 | ]); |
| 36 | // This local tree is NOT the package's registered console tree, so widen |
| 37 | // away the global Register types — the test asserts runtime semantics. |
| 38 | // oxlint-disable-next-line executor/no-double-cast -- boundary: a test-local route tree must escape the package-global router Register types |
| 39 | return createRouter({ |
| 40 | routeTree, |
| 41 | history: createMemoryHistory({ initialEntries: ["/"] }), |
| 42 | }) as unknown as SpikeRouter; |
| 43 | }; |
| 44 | |
| 45 | describe("optional org-slug segment", () => { |
| 46 | it("matches bare and slugged URLs with the same route", async () => { |
no outgoing calls
no test coverage detected