Skip to content

Commit

Permalink
Fix act related issues in test/hooks/useSelector.spec.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
aryaemami59 authored and markerikson committed Dec 10, 2024
1 parent 1cd1385 commit e08518a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/hooks/useSelector.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,11 @@ describe('React', () => {
</ProviderMock>,
)

const doDispatch = () => normalStore.dispatch({ type: '' })
const doDispatch = () => {
rtl.act(() => {
normalStore.dispatch({ type: '' })
})
}
expect(doDispatch).not.toThrowError()

spy.mockRestore()
Expand Down

0 comments on commit e08518a

Please sign in to comment.