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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user