Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Commit

Permalink
fix(tests): incorrectly resetting canvas mock
Browse files Browse the repository at this point in the history
  • Loading branch information
nobrayner committed Dec 31, 2020
1 parent 0638d44 commit ce51bca
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
import { act, render, screen } from '@testing-library/react'
import userEvent from '@testing-library/user-event'
import React from 'react'
import { ReactQueryConfigProvider } from 'react-query'

import AddRelatedPersonModal from '../../../patients/related-persons/AddRelatedPersonModal'
import PatientRepository from '../../../shared/db/PatientRepository'
import Patient from '../../../shared/model/Patient'
import { expectOneConsoleError } from '../../test-utils/console.utils'

const noRetryConfig = {
queries: {
retry: false,
},
}

describe('Add Related Person Modal', () => {
const patients = [
{
Expand All @@ -35,14 +28,12 @@ describe('Add Related Person Modal', () => {
jest.spyOn(PatientRepository, 'count').mockResolvedValue(2)

return render(
<ReactQueryConfigProvider config={noRetryConfig}>
<AddRelatedPersonModal
show
patientId={patients[0].id}
onCloseButtonClick={jest.fn()}
toggle={jest.fn()}
/>
</ReactQueryConfigProvider>,
<AddRelatedPersonModal
show
patientId={patients[0].id}
onCloseButtonClick={jest.fn()}
toggle={jest.fn()}
/>,
)
}

Expand Down Expand Up @@ -136,6 +127,6 @@ describe('Add Related Person Modal', () => {
],
}),
)
}, 40000)
}, 60000)
})
})
1 change: 0 additions & 1 deletion src/setupTests.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ configure({ defaultHidden: true })
jest.setTimeout(10000)

afterEach(() => {
jest.resetAllMocks()
jest.restoreAllMocks()
queryCache.clear()
})
Expand Down

0 comments on commit ce51bca

Please sign in to comment.