Skip to content

Commit

Permalink
add test to reach test coverage threshold
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinxh committed May 12, 2023
1 parent 6758091 commit 01da484
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,12 @@ describe('AppErrorBoundary', () => {
const result = AppErrorBoundary.getDerivedStateFromError(error)
expect(result.error.message).toEqual(error.toString())
})

test(`componentWillUnmount unlistens to history`, () => {
const unlisten = jest.fn()
const history = {listen: jest.fn().mockReturnValue(unlisten)}
const wrapper = mount(<AppErrorBoundary history={history}>test</AppErrorBoundary>)
wrapper.unmount()
expect(unlisten).toBeCalled()
})
})

0 comments on commit 01da484

Please sign in to comment.