Skip to content

Commit

Permalink
test: mock useLocation
Browse files Browse the repository at this point in the history
  • Loading branch information
kreafox committed Nov 22, 2023
1 parent a360401 commit 746887f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/components/manage/Blocks/Group/Edit.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,16 @@ jest.mock('@plone/volto/helpers', () => ({
getBlocksLayoutFieldname: jest.fn(),
}));

jest.mock('react-router-dom', () => ({
...jest.requireActual('react-router-dom'),
useLocation: () => ({
pathname: '/',
hash: '',
search: '',
state: undefined,
}),
}));

describe('Edit', () => {
const onChangeBlock = jest.fn();
const onChangeField = jest.fn();
Expand Down

0 comments on commit 746887f

Please sign in to comment.