diff --git a/packages/esm-ward-app/src/ward-patient-card/ward-patient-card.tsx b/packages/esm-ward-app/src/ward-patient-card/ward-patient-card.tsx index 57ecfea93..8fec75ab2 100644 --- a/packages/esm-ward-app/src/ward-patient-card/ward-patient-card.tsx +++ b/packages/esm-ward-app/src/ward-patient-card/ward-patient-card.tsx @@ -20,7 +20,7 @@ const WardPatientCard: React.FC = (props) => { // activeBedSelection?.patient.uuid === props.patient?.uuid, })} onClick={() => { - launchWorkspace('ward-patient-notes-workspace', { ...props }); + launchWorkspace('ward-patient-workspace', { ...props }); }}> {/* Name will not be displayed; just there for a11y */} {getPatientName(props.patient.person)} diff --git a/packages/esm-ward-app/src/ward-workspace/ward-patient-notes/form/notes-form.test.tsx b/packages/esm-ward-app/src/ward-workspace/ward-patient-notes/form/notes-form.test.tsx index 7f2465e53..6f1e37970 100644 --- a/packages/esm-ward-app/src/ward-workspace/ward-patient-notes/form/notes-form.test.tsx +++ b/packages/esm-ward-app/src/ward-workspace/ward-patient-notes/form/notes-form.test.tsx @@ -5,6 +5,7 @@ import { showSnackbar, useSession } from '@openmrs/esm-framework'; import { savePatientNote } from './notes-form.resource'; import PatientNotesForm from './notes-form.component'; import { emrApiConfigMock, mockPatient, mockSession } from '__mocks__'; +import useEmrConfiguration from '../../../hooks/useEmrConfiguration'; const testProps = { patientUuid: mockPatient.uuid, @@ -31,14 +32,22 @@ jest.mock('@openmrs/esm-framework', () => { }; }); -jest.mock('../../../hooks/useEmrApiConfig', () => ({ - useEmrApiConfig: jest.fn().mockReturnValue(() => ({ emrApiConfig: emrApiConfigMock })), -})); - jest.mock('./notes-form.resource', () => ({ savePatientNote: jest.fn(), })); +jest.mock('../../../hooks/useEmrConfiguration', () => ({ + __esModule: true, + default: jest.fn(), +})); + +(useEmrConfiguration as jest.Mock).mockReturnValue({ + emrConfiguration: emrApiConfigMock, + mutateEmrConfiguration: jest.fn(), + isLoadingEmrConfiguration: false, + errorFetchingEmrConfiguration: null, +}); + test('renders the visit notes form with all the relevant fields and values', () => { renderWardPatientNotesForm(); diff --git a/packages/esm-ward-app/translations/en.json b/packages/esm-ward-app/translations/en.json index be640bd21..b27754543 100644 --- a/packages/esm-ward-app/translations/en.json +++ b/packages/esm-ward-app/translations/en.json @@ -9,6 +9,7 @@ "errorLoadingPatients": "Error loading admitted patients", "errorLoadingWardLocation": "Error loading ward location", "failedToLoadPatientWorkspace": "Ward patient workspace has failed to load.", + "fetchingEmrConfigurationFailed": "Fetching EMR configuration failed. Try refreshing the page or contact your system administrator.", "invalidLocationSpecified": "Invalid location specified", "invalidWardLocation": "Invalid ward location: {{location}}", "manage": "Manage", @@ -18,6 +19,7 @@ "patientNoteSaveError": "Error saving patient note", "save": "Save", "saving": "Saving...", + "somePartsOfTheFormDidntLoad": "Some parts of the form didn't load", "visitNoteSaved": "Patient note saved", "wardClinicalNotePlaceholder": "Write any notes here", "wardPatientWorkspaceTitle": "Ward Patient",