Remove sub-page href resolution test from PageBlueprint
The test was asserting behavior that now lives in the app PageLayout component. Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com> Made-with: Cursor
This commit is contained in:
@@ -24,7 +24,7 @@ import {
|
||||
createExtensionBlueprint,
|
||||
createExtensionInput,
|
||||
} from '../wiring';
|
||||
import { waitFor, screen } from '@testing-library/react';
|
||||
import { waitFor } from '@testing-library/react';
|
||||
|
||||
describe('PageBlueprint', () => {
|
||||
const mockRouteRef = createRouteRef();
|
||||
@@ -279,50 +279,4 @@ describe('PageBlueprint', () => {
|
||||
}
|
||||
`);
|
||||
});
|
||||
|
||||
it('should resolve sub-page tab hrefs relative to the parent page', async () => {
|
||||
const myPage = PageBlueprint.make({
|
||||
name: 'test-page',
|
||||
params: {
|
||||
path: '/test',
|
||||
routeRef: mockRouteRef,
|
||||
title: 'Test',
|
||||
},
|
||||
});
|
||||
|
||||
const SubPageBlueprint = createExtensionBlueprint({
|
||||
kind: 'sub-page',
|
||||
attachTo: { id: 'page:test-page', input: 'pages' },
|
||||
output: [
|
||||
coreExtensionData.routePath,
|
||||
coreExtensionData.reactElement,
|
||||
coreExtensionData.title.optional(),
|
||||
],
|
||||
factory() {
|
||||
return [
|
||||
coreExtensionData.routePath('config'),
|
||||
coreExtensionData.title('Config'),
|
||||
coreExtensionData.reactElement(<div>Config page</div>),
|
||||
];
|
||||
},
|
||||
});
|
||||
|
||||
const tester = createExtensionTester(myPage).add(
|
||||
SubPageBlueprint.make({ name: 'config', params: {} }),
|
||||
);
|
||||
|
||||
renderInTestApp(tester.reactElement(), {
|
||||
mountedRoutes: {
|
||||
'/test/*': mockRouteRef,
|
||||
},
|
||||
initialRouteEntries: ['/test'],
|
||||
});
|
||||
|
||||
await waitFor(() =>
|
||||
expect(screen.getByRole('tab', { name: 'Config' })).toHaveAttribute(
|
||||
'href',
|
||||
'/test/config',
|
||||
),
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user