add noHtml5Validate prop check to NextScaffolder page test

Signed-off-by: Paul Cowan <paul.cowan@cutting.scot>
This commit is contained in:
Paul Cowan
2022-12-17 11:13:12 +00:00
parent 9b1fadf6d8
commit 90b677a967
@@ -54,11 +54,11 @@ describe('Router', () => {
expect(TemplateWizardPage).toHaveBeenCalled();
});
it('should pass through the transformErrors property', async () => {
it('should pass through the FormProps property', async () => {
const transformErrorsMock = jest.fn();
await renderInTestApp(
<Router FormProps={{ transformErrors: transformErrorsMock }} />,
<Router FormProps={{ transformErrors: transformErrorsMock, noHtml5Validate: true }} />,
{
routeEntries: ['/templates/default/foo'],
},
@@ -68,13 +68,14 @@ describe('Router', () => {
const [
{
FormProps: { transformErrors },
FormProps,
},
] = mock.mock.calls[0];
expect(transformErrors).toEqual(transformErrors);
expect(FormProps).toEqual({transformErrors: transformErrorsMock, noHtml5Validate: true});
});
it('should extract the fieldExtensions and pass them through', async () => {
const mockComponent = () => null;
const CustomFieldExtension = scaffolderPlugin.provide(