fix tests that broke

Signed-off-by: Morgan <mbentell@spotify.com>
This commit is contained in:
Morgan
2022-12-20 09:55:50 +01:00
parent e0dada2000
commit 665c681f3c
@@ -30,9 +30,10 @@ import { TechDocsReaderPage } from './TechDocsReaderPage';
import { Route, useParams } from 'react-router-dom';
import { TechDocsAddons } from '@backstage/plugin-techdocs-react';
import { ReportIssue } from '@backstage/plugin-techdocs-module-addons-contrib';
import { Page } from '@backstage/core-components';
import { FlatRoutes } from '@backstage/core-app-api';
import { Page } from '@backstage/core-components';
const mockEntityMetadata = {
locationMetadata: {
type: 'github',
@@ -112,6 +113,12 @@ describe('<TechDocsReaderPage />', () => {
afterEach(() => {
jest.resetAllMocks();
});
beforeEach(() => {
const realPage = jest.requireActual('@backstage/core-components').Page;
(Page as jest.Mock).mockImplementation(realPage);
});
it('should render a techdocs reader page without children', async () => {
const rendered = await renderInTestApp(
<Wrapper>