-
Notifications
You must be signed in to change notification settings - Fork 221
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(fix) - O3-4017 - Ward App - ward view should refresh data after acti…
…ons on patients (#1327) * (fix) - O3-4017 - Ward App - ward view should refresh data after actions on patients * clean up tests * update esm-framework
- Loading branch information
Showing
16 changed files
with
272 additions
and
371 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -90,3 +90,6 @@ results.xml | |
moduleName | ||
|
||
.env | ||
|
||
# vim | ||
.swp |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import { mockAdmissionLocation, mockInpatientAdmissions, mockInpatientRequest } from '__mocks__'; | ||
import { useAdmissionLocation } from './src/hooks/useAdmissionLocation'; | ||
import { useInpatientAdmission } from './src/hooks/useInpatientAdmission'; | ||
import { createAndGetWardPatientGrouping } from './src/ward-view/ward-view.resource'; | ||
import { useInpatientRequest } from './src/hooks/useInpatientRequest'; | ||
import { useWardPatientGrouping } from './src/hooks/useWardPatientGrouping'; | ||
|
||
jest.mock('./src/hooks/useAdmissionLocation', () => ({ | ||
useAdmissionLocation: jest.fn(), | ||
})); | ||
jest.mock('./src/hooks/useInpatientAdmission', () => ({ | ||
useInpatientAdmission: jest.fn(), | ||
})); | ||
jest.mock('./src/hooks/useInpatientRequest', () => ({ | ||
useInpatientRequest: jest.fn(), | ||
})); | ||
jest.mock('./src/hooks/useWardPatientGrouping', () => ({ | ||
useWardPatientGrouping: jest.fn(), | ||
})); | ||
const mockAdmissionLocationResponse = jest.mocked(useAdmissionLocation).mockReturnValue({ | ||
error: undefined, | ||
mutate: jest.fn(), | ||
isValidating: false, | ||
isLoading: false, | ||
admissionLocation: mockAdmissionLocation, | ||
}); | ||
const mockInpatientAdmissionResponse = jest.mocked(useInpatientAdmission).mockReturnValue({ | ||
data: mockInpatientAdmissions, | ||
hasMore: false, | ||
loadMore: jest.fn(), | ||
isValidating: false, | ||
isLoading: false, | ||
error: undefined, | ||
mutate: jest.fn(), | ||
totalCount: mockInpatientAdmissions.length, | ||
}); | ||
|
||
const mockInpatientRequestResponse = jest.mocked(useInpatientRequest).mockReturnValue({ | ||
inpatientRequests: mockInpatientRequest, | ||
hasMore: false, | ||
loadMore: jest.fn(), | ||
isValidating: false, | ||
isLoading: false, | ||
error: undefined, | ||
mutate: jest.fn(), | ||
totalCount: mockInpatientRequest.length, | ||
}); | ||
|
||
export const mockWardPatientGroupDetails = jest.mocked(useWardPatientGrouping).mockReturnValue({ | ||
admissionLocationResponse: mockAdmissionLocationResponse(), | ||
inpatientAdmissionResponse: mockInpatientAdmissionResponse(), | ||
inpatientRequestResponse: mockInpatientRequestResponse(), | ||
...createAndGetWardPatientGrouping(mockInpatientAdmissions, mockAdmissionLocation, mockInpatientRequest), | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 6 additions & 5 deletions
11
packages/esm-ward-app/src/ward-view-header/admission-requests-bar.component.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 7 additions & 20 deletions
27
packages/esm-ward-app/src/ward-view-header/admission-requests-bar.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.