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:
@@ -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)];
|
||||
},
|
||||
}),
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user