fixup import

Signed-off-by: Emma Indal <emma.indahl@gmail.com>
This commit is contained in:
Emma Indal
2022-07-05 14:51:10 +02:00
committed by Camila Belo
parent e7638fa7e7
commit 43e423cb85
4 changed files with 4 additions and 15 deletions
@@ -16,7 +16,7 @@
import { renderInTestApp } from '@backstage/test-utils';
import React from 'react';
import { useLocation, useOutlet } from 'react-router';
import { useLocation } from 'react-router';
import { useSearch } from '@backstage/plugin-search-react';
import { SearchPage } from './SearchPage';
@@ -50,11 +50,6 @@ jest.mock('@backstage/plugin-search-react', () => ({
}),
}));
jest.mock('../LegacySearchPage', () => ({
...jest.requireActual('@backstage/plugin-search-react'),
LegacySearchPage: jest.fn().mockReturnValue('LegacySearchPageMock'),
}));
describe('SearchPage', () => {
const origReplaceState = window.history.replaceState;
@@ -96,13 +91,6 @@ describe('SearchPage', () => {
expect(getByText('Route Children')).toBeInTheDocument();
});
it('renders legacy search when no router children are provided', async () => {
(useOutlet as jest.Mock).mockReturnValueOnce(null);
const { getByText } = await renderInTestApp(<SearchPage />);
expect(getByText('LegacySearchPageMock')).toBeInTheDocument();
});
it('replaces window history with expected query parameters', async () => {
(useSearch as jest.Mock).mockReturnValueOnce({
term: 'bieber',