@kenyaemr/esm-patient-list-management-app 7.0.3-pre.89 → 8.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +18 -17
- package/dist/112.js +1 -0
- package/dist/112.js.map +1 -0
- package/dist/130.js +1 -1
- package/dist/130.js.map +1 -1
- package/dist/271.js +2 -1
- package/dist/271.js.map +1 -0
- package/dist/37.js +1 -0
- package/dist/37.js.map +1 -0
- package/dist/384.js +1 -0
- package/dist/757.js +1 -1
- package/dist/kenyaemr-esm-patient-list-management-app.js +1 -1
- package/dist/kenyaemr-esm-patient-list-management-app.js.buildmanifest.json +78 -78
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/routes.json +1 -1
- package/package.json +2 -3
- package/src/add-patient/add-patient.scss +14 -5
- package/src/add-patient-to-patient-list-menu-item.test.tsx +4 -6
- package/src/create-edit-patient-list/create-edit-patient-list.scss +5 -6
- package/src/empty-state/empty-state.scss +6 -6
- package/src/error-state/error-state.scss +1 -1
- package/src/header/header.component.tsx +1 -0
- package/src/header/header.scss +8 -8
- package/src/list-details/list-details.scss +27 -7
- package/src/list-details/list-details.test.tsx +34 -24
- package/src/list-details-table/list-details-table.component.tsx +1 -1
- package/src/list-details-table/list-details-table.scss +18 -18
- package/src/list-details-table/list-details-table.test.tsx +3 -8
- package/src/lists-dashboard/lists-dashboard.scss +12 -13
- package/src/lists-dashboard/lists-dashboard.test.tsx +8 -8
- package/src/lists-table/custom-pagination.scss +9 -9
- package/src/lists-table/lists-table.component.tsx +1 -1
- package/src/lists-table/lists-table.scss +7 -7
- package/src/lists-table/lists-table.test.tsx +12 -12
- package/src/overlay.component.tsx +3 -1
- package/src/overlay.scss +10 -10
- package/src/overlay.test.tsx +16 -24
- package/translations/fr.json +19 -19
- package/dist/139.js +0 -1
- package/dist/139.js.map +0 -1
- package/dist/548.js +0 -1
- package/dist/548.js.map +0 -1
- package/dist/930.js +0 -2
- package/dist/930.js.map +0 -1
- package/src/list-details/patient-list-detail.test.tsx +0 -105
- package/src/style.scss +0 -46
- /package/dist/{930.js.LICENSE.txt → 271.js.LICENSE.txt} +0 -0
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { render, screen, fireEvent, waitFor } from '@testing-library/react';
|
|
3
|
-
import userEvent from '@testing-library/user-event';
|
|
4
|
-
import { usePatientListDetails, usePatientListMembers } from '../api/hooks';
|
|
5
|
-
import { showToast } from '@openmrs/esm-framework';
|
|
6
|
-
import { deletePatientList } from '../api/api-remote';
|
|
7
|
-
import PatientListDetailComponent from './patient-list-detail.component';
|
|
8
|
-
|
|
9
|
-
const mockedUsePatientListDetails = usePatientListDetails as jest.Mock;
|
|
10
|
-
const mockedUsePatientListMembers = usePatientListMembers as jest.Mock;
|
|
11
|
-
const mockedDeletePatientList = deletePatientList as jest.Mock;
|
|
12
|
-
|
|
13
|
-
jest.mock('../api/hooks', () => ({
|
|
14
|
-
usePatientListDetails: jest.fn(),
|
|
15
|
-
usePatientListMembers: jest.fn(),
|
|
16
|
-
}));
|
|
17
|
-
|
|
18
|
-
jest.mock('../api/api-remote');
|
|
19
|
-
|
|
20
|
-
jest.mock('@openmrs/esm-framework', () => ({
|
|
21
|
-
...jest.requireActual('@openmrs/esm-framework'),
|
|
22
|
-
showToast: jest.fn(),
|
|
23
|
-
navigate: jest.fn(),
|
|
24
|
-
ExtensionSlot: jest.fn(),
|
|
25
|
-
}));
|
|
26
|
-
|
|
27
|
-
const mockedPatientListDetails = {
|
|
28
|
-
name: 'Test Patient List',
|
|
29
|
-
description: 'This is a test patient list',
|
|
30
|
-
size: 5,
|
|
31
|
-
startDate: '2023-08-14',
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
const mockedPatientListMembers = [
|
|
35
|
-
{
|
|
36
|
-
patient: {
|
|
37
|
-
person: {
|
|
38
|
-
display: 'John Doe',
|
|
39
|
-
gender: 'Male',
|
|
40
|
-
},
|
|
41
|
-
identifiers: [
|
|
42
|
-
{
|
|
43
|
-
identifier: '100GEJ',
|
|
44
|
-
},
|
|
45
|
-
],
|
|
46
|
-
uuid: '7cd38a6d-377e-491b-8284-b04cf8b8c6d8',
|
|
47
|
-
},
|
|
48
|
-
startDate: '2023-08-10',
|
|
49
|
-
},
|
|
50
|
-
];
|
|
51
|
-
|
|
52
|
-
describe('PatientListDetailComponent', () => {
|
|
53
|
-
beforeEach(() => {
|
|
54
|
-
jest.clearAllMocks();
|
|
55
|
-
mockedUsePatientListDetails.mockReturnValue({
|
|
56
|
-
data: mockedPatientListDetails,
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
mockedUsePatientListMembers.mockReturnValue({
|
|
60
|
-
data: mockedPatientListMembers,
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
mockedDeletePatientList.mockResolvedValue({});
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
it('renders patient list details', async () => {
|
|
67
|
-
render(<PatientListDetailComponent />);
|
|
68
|
-
|
|
69
|
-
await waitFor(() => {
|
|
70
|
-
expect(screen.getByText('Test Patient List')).toBeInTheDocument();
|
|
71
|
-
expect(screen.getByText('This is a test patient list')).toBeInTheDocument();
|
|
72
|
-
});
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
it('displays patient list members', async () => {
|
|
76
|
-
render(<PatientListDetailComponent />);
|
|
77
|
-
|
|
78
|
-
await waitFor(() => {
|
|
79
|
-
expect(screen.getByText('John Doe')).toBeInTheDocument();
|
|
80
|
-
expect(screen.getByText('Male')).toBeInTheDocument();
|
|
81
|
-
expect(screen.getByText('100GEJ')).toBeInTheDocument();
|
|
82
|
-
});
|
|
83
|
-
});
|
|
84
|
-
|
|
85
|
-
it('opens edit overlay when "Edit Name/ Description" is clicked', () => {
|
|
86
|
-
render(<PatientListDetailComponent />);
|
|
87
|
-
|
|
88
|
-
userEvent.click(screen.getByText('Actions'));
|
|
89
|
-
const editBtn = screen.getByText('Edit Name/ Description');
|
|
90
|
-
userEvent.click(editBtn);
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
it('deletes patient list and navigates on successful delete', async () => {
|
|
94
|
-
render(<PatientListDetailComponent />);
|
|
95
|
-
|
|
96
|
-
await waitFor(() => {
|
|
97
|
-
userEvent.click(screen.getByText('Delete'));
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
await waitFor(() => {
|
|
101
|
-
expect(mockedDeletePatientList).toHaveBeenCalledTimes(1);
|
|
102
|
-
expect(showToast).toHaveBeenCalledTimes(1);
|
|
103
|
-
});
|
|
104
|
-
});
|
|
105
|
-
});
|
package/src/style.scss
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
@use '@carbon/styles/scss/spacing';
|
|
2
|
-
@use '@carbon/styles/scss/type';
|
|
3
|
-
@import '~@openmrs/esm-styleguide/src/vars';
|
|
4
|
-
|
|
5
|
-
.productiveHeading02 {
|
|
6
|
-
@include type.type-style('heading-compact-02');
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
.productiveHeading03 {
|
|
10
|
-
@include type.type-style('heading-03');
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.productiveHeading04 {
|
|
14
|
-
@include type.type-style('heading-04');
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.bodyLong01 {
|
|
18
|
-
@include type.type-style('body-01');
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.bodyShort01 {
|
|
22
|
-
@include type.type-style('body-compact-01');
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.bodyShort02 {
|
|
26
|
-
@include type.type-style('body-compact-02');
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.text02 {
|
|
30
|
-
color: $text-02;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.label01 {
|
|
34
|
-
@include type.type-style('label-01');
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.modal {
|
|
38
|
-
position: fixed;
|
|
39
|
-
width: 100vw;
|
|
40
|
-
height: 100vh;
|
|
41
|
-
display: grid;
|
|
42
|
-
background-color: rgba(0, 0, 0, 0.5);
|
|
43
|
-
z-index: 9000;
|
|
44
|
-
justify-items: center;
|
|
45
|
-
align-items: center;
|
|
46
|
-
}
|
|
File without changes
|