Fix rest of NavBarItem tests

This commit is contained in:
Ashley Harrison
2022-04-19 14:32:27 +01:00
parent d12a778c0a
commit 20189961a6
@@ -6,6 +6,16 @@ import { locationUtil } from '@grafana/data';
import { config, setLocationService } from '@grafana/runtime';
import TestProvider from '../../../../test/helpers/TestProvider';
// Need to mock createBrowserHistory here to avoid errors
jest.mock('history', () => ({
...jest.requireActual('history'),
createBrowserHistory: () => ({
listen: jest.fn(),
location: {},
createHref: jest.fn(),
}),
}));
import NavBarItem, { Props } from './NavBarItem';
const onClickMock = jest.fn();