From 7efdc27464c8ff45c285c6fe06f37739e6661cd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Mon, 25 May 2026 15:18:11 +0200 Subject: [PATCH] =?UTF-8?q?Remove=20mountPath=20=E2=86=92=20initialRouteEn?= =?UTF-8?q?tries=20defaulting?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Don't auto-default initialRouteEntries from mountPath — for parameterized paths this silently produces wrong params (literal ':name' values). Require callers to set both explicitly. Co-Authored-By: Claude Opus 4.6 (1M context) Signed-off-by: Fredrik Adelöw --- .../src/app/renderInTestApp.tsx | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/packages/frontend-test-utils/src/app/renderInTestApp.tsx b/packages/frontend-test-utils/src/app/renderInTestApp.tsx index 82b9619566..ada78a35a3 100644 --- a/packages/frontend-test-utils/src/app/renderInTestApp.tsx +++ b/packages/frontend-test-utils/src/app/renderInTestApp.tsx @@ -82,12 +82,10 @@ export type TestAppOptions = { /** * The route path pattern that the test element is rendered at. When set, * the element is wrapped in a `` with this path, enabling - * `useParams()` to extract parameters from the URL. Defaults to `'/'`. + * `useParams()` to extract parameters from the URL. * - * When `mountPath` is set and `initialRouteEntries` is not, the - * initial route entry defaults to `mountPath` (which works for paths - * without parameters). For parameterized paths you must also set - * `initialRouteEntries` to a concrete URL that matches the pattern. + * Should be used together with `initialRouteEntries` to set a concrete + * URL that matches the pattern. * * @example * ```ts @@ -100,8 +98,7 @@ export type TestAppOptions = { mountPath?: string; /** - * Initial route entries to use for the router. When `mountPath` is set - * and this is not, defaults to `[mountPath]`. + * Initial route entries to use for the router. */ initialRouteEntries?: string[]; @@ -214,10 +211,7 @@ export function renderInTestApp( params: { component: ({ children }) => (