Add changeset for renderInTestApp route matching fix

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
Fredrik Adelöw
2026-05-20 10:29:27 +02:00
parent a06003bc90
commit 62dd4fc3bc
2 changed files with 9 additions and 2 deletions
@@ -135,6 +135,7 @@ export function renderInTestApp<const TApiPairs extends any[] = any[]>(
output: [coreExtensionData.reactElement],
factory: () => {
let content: JSX.Element = element;
if (mountedPaths.length > 0) {
content = (
<Routes>
@@ -142,13 +143,14 @@ export function renderInTestApp<const TApiPairs extends any[] = any[]>(
<Route
key={path}
path={path === '/' ? path : `${path.replace(/\/$/, '')}/*`}
element={element}
element={content}
/>
))}
<Route path="*" element={element} />
<Route path="*" element={content} />
</Routes>
);
}
return [coreExtensionData.reactElement(content)];
},
}),