From 50be5c09aa599c387e301a736f845acbe9f973ce Mon Sep 17 00:00:00 2001 From: tudi2d Date: Fri, 12 Mar 2021 15:30:39 +0100 Subject: [PATCH] Add rootRouteRef to test app options to fix component tests Signed-off-by: tudi2d --- .../src/reader/components/TechDocsPageHeader.test.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/techdocs/src/reader/components/TechDocsPageHeader.test.tsx b/plugins/techdocs/src/reader/components/TechDocsPageHeader.test.tsx index 8128366392..082caeeb09 100644 --- a/plugins/techdocs/src/reader/components/TechDocsPageHeader.test.tsx +++ b/plugins/techdocs/src/reader/components/TechDocsPageHeader.test.tsx @@ -18,6 +18,7 @@ import { TechDocsPageHeader } from './TechDocsPageHeader'; import { act } from '@testing-library/react'; import { renderInTestApp } from '@backstage/test-utils'; import { entityRouteRef } from '@backstage/plugin-catalog-react'; +import { rootRouteRef } from '../../plugin'; describe('', () => { it('should render a techdocs page header', async () => { @@ -54,6 +55,7 @@ describe('', () => { { mountedRoutes: { '/catalog/:namespace/:kind/:name/*': entityRouteRef, + '/docs': rootRouteRef, }, }, ); @@ -85,6 +87,7 @@ describe('', () => { { mountedRoutes: { '/catalog/:namespace/:kind/:name/*': entityRouteRef, + '/docs': rootRouteRef, }, }, ); @@ -118,6 +121,7 @@ describe('', () => { { mountedRoutes: { '/catalog/:namespace/:kind/:name/*': entityRouteRef, + '/docs': rootRouteRef, }, }, );