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

Commit

Permalink
test(addcareplanmodat.test.tsx): update tests to use RTL
Browse files Browse the repository at this point in the history
fix #108
  • Loading branch information
emma-r-slight committed Dec 28, 2020
1 parent f35d14d commit 82d598e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/__tests__/patients/care-plans/AddCarePlanModal.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ describe('Add Care Plan Modal', () => {

const onCloseSpy = jest.fn()
const setup = () => {
jest.resetAllMocks()
jest.spyOn(PatientRepository, 'find').mockResolvedValue(patient)
jest.spyOn(PatientRepository, 'saveOrUpdate')
const history = createMemoryHistory()
Expand Down Expand Up @@ -76,7 +77,7 @@ describe('Add Care Plan Modal', () => {
userEvent.type(title, newCarePlan.title)
userEvent.type(description, newCarePlan.description)

userEvent.click(screen.getByRole('button', { name: /patient\.carePlan\.new/i }))
userEvent.click(await screen.getByRole('button', { name: /patient\.carePlan\.new/i }))

await waitFor(() => {
expect(PatientRepository.saveOrUpdate).toHaveBeenCalled()
Expand Down

0 comments on commit 82d598e

Please sign in to comment.