From a360401b8ee05e9cb54b253b0e605d0a040c8f78 Mon Sep 17 00:00:00 2001 From: kreafox Date: Wed, 22 Nov 2023 10:30:30 +0200 Subject: [PATCH] test: mock useLocation --- src/components/manage/Blocks/Group/View.test.jsx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/components/manage/Blocks/Group/View.test.jsx b/src/components/manage/Blocks/Group/View.test.jsx index b9f96a0..0ad0342 100644 --- a/src/components/manage/Blocks/Group/View.test.jsx +++ b/src/components/manage/Blocks/Group/View.test.jsx @@ -14,6 +14,16 @@ jest.mock('@plone/volto/helpers', () => ({ withBlockExtensions: jest.fn((Component) => Component), })); +jest.mock('react-router-dom', () => ({ + ...jest.requireActual('react-router-dom'), + useLocation: () => ({ + pathname: '/', + hash: '', + search: '', + state: undefined, + }), +})); + describe('View', () => { it('should render without crashing', () => { const props = {