From 82d598e5f18073866c3d046f8ce417ddf42413bf Mon Sep 17 00:00:00 2001 From: Emma Slight Date: Mon, 28 Dec 2020 20:30:16 +1300 Subject: [PATCH] test(addcareplanmodat.test.tsx): update tests to use RTL fix #108 --- src/__tests__/patients/care-plans/AddCarePlanModal.test.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/__tests__/patients/care-plans/AddCarePlanModal.test.tsx b/src/__tests__/patients/care-plans/AddCarePlanModal.test.tsx index 4434438650..2efd503de7 100644 --- a/src/__tests__/patients/care-plans/AddCarePlanModal.test.tsx +++ b/src/__tests__/patients/care-plans/AddCarePlanModal.test.tsx @@ -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() @@ -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()