pass through transformErrors to TemplateWizardPage
Signed-off-by: Paul Cowan <paul.cowan@cutting.scot>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-scaffolder': patch
|
||||
---
|
||||
|
||||
Pass through transformErrors to TemplateWizardPage
|
||||
@@ -54,6 +54,20 @@ describe('Router', () => {
|
||||
expect(TemplateWizardPage).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('should pass through the transformErrors property', async () => {
|
||||
const transformErrorsMock = jest.fn();
|
||||
|
||||
await renderInTestApp(<Router transformErrors={transformErrorsMock} />, {
|
||||
routeEntries: ['/templates/default/foo'],
|
||||
});
|
||||
|
||||
const mock = TemplateWizardPage as jest.Mock;
|
||||
|
||||
const [{ transformErrors }] = mock.mock.calls[0];
|
||||
|
||||
expect(transformErrors).toEqual(transformErrors);
|
||||
});
|
||||
|
||||
it('should extract the fieldExtensions and pass them through', async () => {
|
||||
const mockComponent = () => null;
|
||||
const CustomFieldExtension = scaffolderPlugin.provide(
|
||||
|
||||
@@ -93,7 +93,10 @@ export const Router = (props: PropsWithChildren<NextRouterProps>) => {
|
||||
path={nextSelectedTemplateRouteRef.path}
|
||||
element={
|
||||
<SecretsContextProvider>
|
||||
<TemplateWizardPage customFieldExtensions={fieldExtensions} />
|
||||
<TemplateWizardPage
|
||||
customFieldExtensions={fieldExtensions}
|
||||
transformErrors={props.transformErrors}
|
||||
/>
|
||||
</SecretsContextProvider>
|
||||
}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user