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 87ae0df commit a360401
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/components/manage/Blocks/Group/View.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down

0 comments on commit a360401

Please sign in to comment.