Skip to content

Commit

Permalink
Add router mocks
Browse files Browse the repository at this point in the history
  • Loading branch information
kqualters-elastic committed Dec 15, 2021
1 parent 285fa10 commit 7167204
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ import { AlertsCountAggregation } from './types';
jest.mock('../../../../common/lib/kibana');
const mockDispatch = jest.fn();

jest.mock('react-router-dom', () => {
const actual = jest.requireActual('react-router-dom');
return { ...actual, useLocation: jest.fn().mockReturnValue({ pathname: '' }) };
});

jest.mock('react-redux', () => {
const original = jest.requireActual('react-redux');
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ import { TestProviders } from '../../../../common/mock';

import { AlertsCountPanel } from './index';

jest.mock('react-router-dom', () => {
const actual = jest.requireActual('react-router-dom');
return { ...actual, useLocation: jest.fn().mockReturnValue({ pathname: '' }) };
});

describe('AlertsCountPanel', () => {
const defaultProps = {
signalIndexName: 'signalIndexName',
Expand Down

0 comments on commit 7167204

Please sign in to comment.