1- import { launchWorkspace , openmrsFetch } from '@openmrs/esm-framework' ;
1+ import { openmrsFetch } from '@openmrs/esm-framework' ;
2+ import { launchPatientWorkspace } from '@openmrs/esm-patient-common-lib' ;
23import dayjs from 'dayjs' ;
34import { launchClinicalViewForm , mealSymbol , getPatientEncounterDates } from './helpers' ;
45import { dateFormat } from '../constants' ;
56
67jest . mock ( '@openmrs/esm-patient-common-lib' , ( ) => ( {
7- launchWorkspace : jest . fn ( ) ,
8+ launchPatientWorkspace : jest . fn ( ) ,
89} ) ) ;
910
1011jest . mock ( '@openmrs/esm-framework' , ( ) => ( {
@@ -13,15 +14,15 @@ jest.mock('@openmrs/esm-framework', () => ({
1314} ) ) ;
1415
1516describe ( 'launchClinicalViewForm' , ( ) => {
16- it ( 'should call launchWorkspace with correct parameters' , ( ) => {
17+ it ( 'should call launchPatientWorkspace with correct parameters' , ( ) => {
1718 const form = { name : 'Test Form' } as any ;
1819 const patientUuid = 'patient-uuid' ;
1920 const onFormSave = jest . fn ( ) ;
2021 const action = 'add' ;
2122
2223 launchClinicalViewForm ( form , patientUuid , onFormSave , action ) ;
2324
24- expect ( launchWorkspace ) . toHaveBeenCalledWith ( 'patient-form-entry-workspace' , {
25+ expect ( launchPatientWorkspace ) . toHaveBeenCalledWith ( 'patient-form-entry-workspace' , {
2526 workspaceTitle : form . name ,
2627 mutateForm : onFormSave ,
2728 formInfo : {
0 commit comments