From 4a53805032b53df76021e2608eff6bd219947a91 Mon Sep 17 00:00:00 2001 From: Dmytro Melnyshyn Date: Mon, 25 Nov 2024 15:37:37 +0200 Subject: [PATCH] mock withRouter --- src/QuickMarcEditor/QuickMarcEditor.test.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/QuickMarcEditor/QuickMarcEditor.test.js b/src/QuickMarcEditor/QuickMarcEditor.test.js index 214a7d81..18dd6c13 100644 --- a/src/QuickMarcEditor/QuickMarcEditor.test.js +++ b/src/QuickMarcEditor/QuickMarcEditor.test.js @@ -2,6 +2,8 @@ import React from 'react'; import faker from 'faker'; import { useLocation } from 'react-router'; +import { createMemoryHistory } from 'history'; + import { render, @@ -25,9 +27,12 @@ import Harness from '../../test/jest/helpers/harness'; import buildStripes from '../../test/jest/__mock__/stripesCore.mock'; import { bibLeader } from '../../test/jest/fixtures/leaders'; +const mockHistory = createMemoryHistory(); + jest.mock('react-router', () => ({ ...jest.requireActual('react-router'), useLocation: jest.fn(), + withRouter: Component => props => , })); jest.mock('../queries', () => ({