Switch to in-memory catalog client for entity page tests

Now that renderInTestApp properly sets up Route matching, the test can
use the real in-memory catalog client instead of jest stubs. The
in-memory client does actual ref-based lookups, verifying that
useEntityFromUrl receives correct route params end-to-end.

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:04:51 +02:00
parent 95e107bc6e
commit a06003bc90
2 changed files with 32 additions and 80 deletions
@@ -134,23 +134,22 @@ export function renderInTestApp<const TApiPairs extends any[] = any[]>(
attachTo: { id: 'app/root', input: 'children' },
output: [coreExtensionData.reactElement],
factory: () => {
let content: JSX.Element = element;
if (mountedPaths.length > 0) {
return [
coreExtensionData.reactElement(
<Routes>
{mountedPaths.map(path => (
<Route
key={path}
path={path === '/' ? path : `${path.replace(/\/$/, '')}/*`}
element={element}
/>
))}
<Route path="*" element={element} />
</Routes>,
),
];
content = (
<Routes>
{mountedPaths.map(path => (
<Route
key={path}
path={path === '/' ? path : `${path.replace(/\/$/, '')}/*`}
element={element}
/>
))}
<Route path="*" element={element} />
</Routes>
);
}
return [coreExtensionData.reactElement(element)];
return [coreExtensionData.reactElement(content)];
},
}),
];