feat: fixing tests

Signed-off-by: blam <ben@blam.sh>
This commit is contained in:
blam
2023-10-02 13:51:29 +02:00
committed by Patrik Oldsberg
parent da462fffc7
commit c04f436b61
2 changed files with 6 additions and 9 deletions
@@ -18,7 +18,7 @@ jest.mock('@backstage/plugin-catalog-react', () => ({
useEntityList: jest.fn(),
}));
jest.mock('@backstage/plugin-scaffolder-react/alpha', () => ({
jest.mock('../TemplateGroup/TemplateGroup', () => ({
TemplateGroup: jest.fn(() => null),
}));
@@ -27,7 +27,7 @@ import { useEntityList } from '@backstage/plugin-catalog-react';
import { TemplateGroups } from './TemplateGroups';
import { renderInTestApp, TestApiProvider } from '@backstage/test-utils';
import { errorApiRef } from '@backstage/core-plugin-api';
import { TemplateGroup } from '@backstage/plugin-scaffolder-react/alpha';
import { TemplateGroup } from '../TemplateGroup/TemplateGroup';
describe('TemplateGroups', () => {
beforeEach(() => jest.clearAllMocks());
@@ -27,12 +27,9 @@ import {
} from '@backstage/plugin-scaffolder-react';
import { TemplateListPage, TemplateWizardPage } from '../../next';
jest.mock('../TemplateListPage', () => ({
TemplateListPage: jest.fn(() => null),
}));
jest.mock('../TemplateWizardPage', () => ({
jest.mock('../../next', () => ({
TemplateWizardPage: jest.fn(() => null),
TemplateListPage: jest.fn(() => null),
}));
describe('Router', () => {
@@ -104,9 +101,9 @@ describe('Router', () => {
const mock = TemplateWizardPage as jest.Mock;
const [{ FormProps }] = mock.mock.calls[0];
const [{ formProps }] = mock.mock.calls[0];
expect(FormProps).toEqual({
expect(formProps).toEqual({
transformErrors: transformErrorsMock,
noHtml5Validate: true,
});