From 8843070f1898cb6639df3fe0583172cbf3c769c7 Mon Sep 17 00:00:00 2001 From: reidmeyer Date: Fri, 19 Jun 2020 16:59:33 -0500 Subject: [PATCH 1/2] fix: issue 2127. Care Plan Note Not Required Worked with WUSTL Group (Anya Pawar, Samika Kikkeri, Fadel Alkilani). First issue. fix #2127 --- src/__tests__/patients/care-plans/CarePlanForm.test.tsx | 1 - src/__tests__/patients/patient-slice.test.ts | 1 - src/patients/care-plans/CarePlanForm.tsx | 1 - src/patients/patient-slice.ts | 4 ---- 4 files changed, 7 deletions(-) diff --git a/src/__tests__/patients/care-plans/CarePlanForm.test.tsx b/src/__tests__/patients/care-plans/CarePlanForm.test.tsx index 20f83dd4c8..d5441b4a36 100644 --- a/src/__tests__/patients/care-plans/CarePlanForm.test.tsx +++ b/src/__tests__/patients/care-plans/CarePlanForm.test.tsx @@ -226,7 +226,6 @@ describe('Care Plan Form', () => { const noteInput = wrapper.findWhere((w) => w.prop('name') === 'note') expect(noteInput).toHaveLength(1) expect(noteInput.prop('patient.carePlan.note')) - expect(noteInput.prop('isRequired')).toBeTruthy() expect(noteInput.prop('value')).toEqual(carePlan.note) }) diff --git a/src/__tests__/patients/patient-slice.test.ts b/src/__tests__/patients/patient-slice.test.ts index 829fb43d56..53a7c2da5d 100644 --- a/src/__tests__/patients/patient-slice.test.ts +++ b/src/__tests__/patients/patient-slice.test.ts @@ -699,7 +699,6 @@ describe('patients slice', () => { startDate: 'patient.carePlan.error.startDateRequired', endDate: 'patient.carePlan.error.endDateRequired', condition: 'patient.carePlan.error.conditionRequired', - note: 'patient.carePlan.error.noteRequired', } const store = mockStore() const expectedCarePlan = {} as CarePlan diff --git a/src/patients/care-plans/CarePlanForm.tsx b/src/patients/care-plans/CarePlanForm.tsx index 0845250a40..6a5a24e7d9 100644 --- a/src/patients/care-plans/CarePlanForm.tsx +++ b/src/patients/care-plans/CarePlanForm.tsx @@ -145,7 +145,6 @@ const CarePlanForm = (props: Props) => { Date: Mon, 22 Jun 2020 20:01:05 -0500 Subject: [PATCH 2/2] test: add missing mocks --- src/__tests__/patients/care-plans/AddCarePlanModal.test.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/__tests__/patients/care-plans/AddCarePlanModal.test.tsx b/src/__tests__/patients/care-plans/AddCarePlanModal.test.tsx index e62b486275..340fdbcb60 100644 --- a/src/__tests__/patients/care-plans/AddCarePlanModal.test.tsx +++ b/src/__tests__/patients/care-plans/AddCarePlanModal.test.tsx @@ -9,6 +9,7 @@ import { Router } from 'react-router-dom' import createMockStore from 'redux-mock-store' import thunk from 'redux-thunk' +import PatientRepository from '../../../clients/db/PatientRepository' import { CarePlanIntent, CarePlanStatus } from '../../../model/CarePlan' import Patient from '../../../model/Patient' import AddCarePlanModal from '../../../patients/care-plans/AddCarePlanModal' @@ -42,6 +43,8 @@ describe('Add Care Plan Modal', () => { const onCloseSpy = jest.fn() const setup = () => { + jest.spyOn(PatientRepository, 'find').mockResolvedValue(patient) + jest.spyOn(PatientRepository, 'saveOrUpdate') const store = mockStore({ patient: { patient, carePlanError } } as any) const history = createMemoryHistory() const wrapper = mount(