plugins: fix tests for react router bump

Co-authored-by: Fredrik Adelöw <freben@gmail.com>
Co-authored-by: blam <ben@blam.sh>
Co-authored-by: Johan Haals <johan.haals@gmail.com>
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2022-08-24 15:48:49 +02:00
parent baa2ec822d
commit 9f1feb5464
6 changed files with 55 additions and 66 deletions
+4 -10
View File
@@ -18,7 +18,6 @@ import React from 'react';
import { wrapInTestApp } from '@backstage/test-utils';
import { act, render } from '@testing-library/react';
import { useNavigateToQuery } from './util';
import { Routes, Route } from 'react-router-dom';
import { rootRouteRef } from '../plugin';
const navigate = jest.fn();
@@ -38,16 +37,11 @@ describe('util', () => {
await act(async () => {
await render(
wrapInTestApp(
<Routes>
<Route element={<MyComponent />} />
</Routes>,
{
mountedRoutes: {
'/search': rootRouteRef,
},
wrapInTestApp(<MyComponent />, {
mountedRoutes: {
'/search': rootRouteRef,
},
),
}),
);
expect(navigate).toHaveBeenCalledTimes(1);