diff --git a/plugins/scaffolder/src/next/Router/Router.test.tsx b/plugins/scaffolder/src/next/Router/Router.test.tsx index 9565572a2f..3d52dd0dd0 100644 --- a/plugins/scaffolder/src/next/Router/Router.test.tsx +++ b/plugins/scaffolder/src/next/Router/Router.test.tsx @@ -47,6 +47,21 @@ describe('Router', () => { expect(TemplateListPage).toHaveBeenCalled(); }); + + it('should render user-provided TemplateListPage', async () => { + const { getByText } = await renderInTestApp( + <>foobar, + }} + />, + { + routeEntries: ['/'], + }, + ); + expect(getByText('foobar')).toBeInTheDocument(); + expect(TemplateListPage).not.toHaveBeenCalled(); + }); }); describe('/templates/:templateName', () => { @@ -58,6 +73,21 @@ describe('Router', () => { expect(TemplateWizardPage).toHaveBeenCalled(); }); + it('should render user-provided TemplateWizardPage', async () => { + const { getByText } = await renderInTestApp( + <>foobar, + }} + />, + { + routeEntries: ['/templates/default/foo'], + }, + ); + expect(getByText('foobar')).toBeInTheDocument(); + expect(TemplateWizardPage).not.toHaveBeenCalled(); + }); + it('should pass through the FormProps property', async () => { const transformErrorsMock = jest.fn();