Skip to content

Commit

Permalink
fix: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
simoneb committed Mar 6, 2021
1 parent 7eb80e9 commit 4176d94
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/index.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -452,23 +452,23 @@ function standardTests(
it('should not cancel the outstanding request when the component rerenders with equal string config', async () => {
axios.mockResolvedValue({ data: 'whatever' })

const { waitForNextUpdate, rerender } = setup('initial config')
const { waitForNextUpdate, rerender } = setup('initial config', {})

await waitForNextUpdate()

rerender({ config: 'initial config' })
rerender({ config: 'initial config', options: {} })

expect(cancel).not.toHaveBeenCalled()
})

it('should not cancel the outstanding request when the component rerenders with equal object config', async () => {
axios.mockResolvedValue({ data: 'whatever' })

const { waitForNextUpdate, rerender } = setup({ some: 'config' })
const { waitForNextUpdate, rerender } = setup({ some: 'config' }, {})

await waitForNextUpdate()

rerender({ config: { some: 'config' } })
rerender({ config: { some: 'config' }, options: {} })

expect(cancel).not.toHaveBeenCalled()
})
Expand Down

0 comments on commit 4176d94

Please sign in to comment.