From b426b61eb8c71a4a2cdbbe83fcbcef2ac9e3df29 Mon Sep 17 00:00:00 2001 From: Rhys Sullivan <39114868+RhysSullivan@users.noreply.github.com> Date: Wed, 30 Sep 2026 11:39:33 -0700 Subject: [PATCH] Start the org-slug inheritance test on the slugged URL --- packages/react/src/org-slug-routing.test.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/react/src/org-slug-routing.test.ts b/packages/react/src/org-slug-routing.test.ts index a7e4db431f..26d4a39e22 100644 --- a/packages/react/src/org-slug-routing.test.ts +++ b/packages/react/src/org-slug-routing.test.ts @@ -12,11 +12,10 @@ type RouteMatch = { readonly routeId: string; readonly params: Record; buildLocation(options: unknown): { readonly href: string }; - navigate(options: unknown): Promise; load(): Promise; }; -const make = (): SpikeRouter => { +const make = (initialPath = "/"): SpikeRouter => { const rootRoute = createRootRoute(); const orgScope = createRoute({ getParentRoute: () => rootRoute, @@ -38,7 +37,7 @@ const make = (): SpikeRouter => { // oxlint-disable-next-line executor/no-double-cast -- boundary: a test-local route tree must escape the package-global router Register types return createRouter({ routeTree, - history: createMemoryHistory({ initialEntries: ["/"] }), + history: createMemoryHistory({ initialEntries: [initialPath] }), }) as unknown as SpikeRouter; }; @@ -84,8 +83,9 @@ describe("optional org-slug segment", () => { }); it("inherits the slug param on relative navigations", async () => { - const router = make(); - await router.navigate({ to: "/{-$orgSlug}", params: { orgSlug: "acme" } }); + // Start on the slugged URL: without a DOM the router runs in server mode, + // where navigate() does not move the location. + const router = make("/acme"); await router.load(); // A link that only supplies its own params keeps the current orgSlug. const href = router.buildLocation({