@openmrs/esm-appointments-app 5.2.2-pre.2441 → 5.2.2-pre.2445
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 +1 -1
- package/dist/755.js +1 -1
- package/dist/755.js.map +1 -1
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/openmrs-esm-appointments-app.js.buildmanifest.json +6 -6
- package/dist/routes.json +1 -1
- package/package.json +1 -1
- package/src/appointments/appointment-tabs.component.tsx +2 -2
- package/src/appointments/appointment-tabs.test.tsx +4 -4
- package/src/appointments/forms/cancel-form/cancel-appointment.test.tsx +1 -1
- package/src/appointments/forms/create-edit-form/appointments-form.component.tsx +1 -1
- package/src/appointments/forms/create-edit-form/appointments-form.test.tsx +11 -6
- package/src/appointments-metrics/appointments-metrics.test.tsx +7 -9
- package/src/appointments.test.tsx +6 -4
- package/src/home-appointments/appointments-list.test.tsx +3 -3
- package/src/overlay.component.tsx +2 -2
- package/tsconfig.json +1 -1
|
@@ -80,10 +80,10 @@
|
|
|
80
80
|
"initial": true,
|
|
81
81
|
"entry": true,
|
|
82
82
|
"recorded": false,
|
|
83
|
-
"size":
|
|
83
|
+
"size": 4539075,
|
|
84
84
|
"sizes": {
|
|
85
85
|
"consume-shared": 252,
|
|
86
|
-
"javascript":
|
|
86
|
+
"javascript": 4518153,
|
|
87
87
|
"share-init": 252,
|
|
88
88
|
"runtime": 20418
|
|
89
89
|
},
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
"auxiliaryFiles": [
|
|
101
101
|
"main.js.map"
|
|
102
102
|
],
|
|
103
|
-
"hash": "
|
|
103
|
+
"hash": "dec2b68504957b7c",
|
|
104
104
|
"childrenByOrder": {}
|
|
105
105
|
},
|
|
106
106
|
{
|
|
@@ -422,9 +422,9 @@
|
|
|
422
422
|
"initial": false,
|
|
423
423
|
"entry": false,
|
|
424
424
|
"recorded": false,
|
|
425
|
-
"size":
|
|
425
|
+
"size": 480628,
|
|
426
426
|
"sizes": {
|
|
427
|
-
"javascript":
|
|
427
|
+
"javascript": 480460,
|
|
428
428
|
"consume-shared": 168
|
|
429
429
|
},
|
|
430
430
|
"names": [],
|
|
@@ -438,7 +438,7 @@
|
|
|
438
438
|
"auxiliaryFiles": [
|
|
439
439
|
"755.js.map"
|
|
440
440
|
],
|
|
441
|
-
"hash": "
|
|
441
|
+
"hash": "d3b687a28836d475",
|
|
442
442
|
"childrenByOrder": {}
|
|
443
443
|
},
|
|
444
444
|
{
|
package/dist/routes.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"webservices.rest":"^2.2.0"},"extensions":[{"name":"home-appointments","slot":"homepage-widgets-slot","component":"homeAppointments","order":1},{"name":"clinical-appointments-dashboard-link","slot":"homepage-dashboard-slot","component":"appointmentsDashboardLink","meta":{"name":"appointments","slot":"clinical-appointments-dashboard-slot","title":"Appointments"}},{"component":"root","name":"clinical-appointments-dashboard","slot":"clinical-appointments-dashboard-slot"},{"name":"appointments-calendar-dashboard-link","slot":"calendar-dashboard-slot","component":"appointmentsCalendarDashboardLink"},{"name":"check-in-appointment-modal","slot":"todays-appointment-slot","component":"checkInModal"},{"name":"todays-appointments-dashboard","slot":"todays-appointment-slot","component":"homeAppointments"},{"name":"expected-appointments-panel","slot":"scheduled-appointments-panels-slot","component":"appointmentsByStatus"},{"name":"checked-in-appointments-panel","slot":"scheduled-appointments-panels-slot","component":"appointmentsByStatus"},{"name":"completed-appointments-panel","slot":"scheduled-appointments-panels-slot","component":"appointmentsByStatus"},{"name":"missed-appointments-panel","slot":"scheduled-appointments-panels-slot","component":"appointmentsByStatus"},{"name":"cancelled-appointments-panel","slot":"scheduled-appointments-panels-slot","component":"appointmentsByStatus"},{"name":"early-appointments-panel","component":"earlyAppointments"}],"version":"5.2.2-pre.
|
|
1
|
+
{"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"webservices.rest":"^2.2.0"},"extensions":[{"name":"home-appointments","slot":"homepage-widgets-slot","component":"homeAppointments","order":1},{"name":"clinical-appointments-dashboard-link","slot":"homepage-dashboard-slot","component":"appointmentsDashboardLink","meta":{"name":"appointments","slot":"clinical-appointments-dashboard-slot","title":"Appointments"}},{"component":"root","name":"clinical-appointments-dashboard","slot":"clinical-appointments-dashboard-slot"},{"name":"appointments-calendar-dashboard-link","slot":"calendar-dashboard-slot","component":"appointmentsCalendarDashboardLink"},{"name":"check-in-appointment-modal","slot":"todays-appointment-slot","component":"checkInModal"},{"name":"todays-appointments-dashboard","slot":"todays-appointment-slot","component":"homeAppointments"},{"name":"expected-appointments-panel","slot":"scheduled-appointments-panels-slot","component":"appointmentsByStatus"},{"name":"checked-in-appointments-panel","slot":"scheduled-appointments-panels-slot","component":"appointmentsByStatus"},{"name":"completed-appointments-panel","slot":"scheduled-appointments-panels-slot","component":"appointmentsByStatus"},{"name":"missed-appointments-panel","slot":"scheduled-appointments-panels-slot","component":"appointmentsByStatus"},{"name":"cancelled-appointments-panel","slot":"scheduled-appointments-panels-slot","component":"appointmentsByStatus"},{"name":"early-appointments-panel","component":"earlyAppointments"}],"version":"5.2.2-pre.2445"}
|
package/package.json
CHANGED
|
@@ -2,12 +2,12 @@ import React, { useState } from 'react';
|
|
|
2
2
|
import { useTranslation } from 'react-i18next';
|
|
3
3
|
import { Tab, TabList, Tabs, TabPanel, TabPanels } from '@carbon/react';
|
|
4
4
|
|
|
5
|
+
import { type ConfigObject } from '../config-schema';
|
|
6
|
+
import { useConfig } from '@openmrs/esm-framework';
|
|
5
7
|
import { useVisits } from '../hooks/useVisits';
|
|
6
8
|
import ScheduledAppointments from './scheduled/scheduled-appointments.component';
|
|
7
9
|
import UnscheduledAppointments from './unscheduled/unscheduled-appointments.component';
|
|
8
10
|
import styles from './appointment-tabs.scss';
|
|
9
|
-
import { ConfigObject } from '../config-schema';
|
|
10
|
-
import { useConfig } from '@openmrs/esm-framework';
|
|
11
11
|
|
|
12
12
|
interface AppointmentTabsProps {
|
|
13
13
|
appointmentServiceType: string;
|
|
@@ -2,13 +2,13 @@ import React from 'react';
|
|
|
2
2
|
import { screen } from '@testing-library/react';
|
|
3
3
|
import userEvent from '@testing-library/user-event';
|
|
4
4
|
import { openmrsFetch } from '@openmrs/esm-framework';
|
|
5
|
-
import { renderWithSwr, waitForLoadingToFinish } from '
|
|
5
|
+
import { renderWithSwr, waitForLoadingToFinish } from 'tools';
|
|
6
|
+
import { mockAppointmentsData } from '__mocks__';
|
|
6
7
|
import AppointmentTabs from './appointment-tabs.component';
|
|
7
|
-
import { mockAppointmentsData } from '../../../../__mocks__/appointments.mock';
|
|
8
8
|
|
|
9
9
|
const mockOpenmrsFetch = openmrsFetch as jest.Mock;
|
|
10
10
|
|
|
11
|
-
jest.setTimeout(
|
|
11
|
+
jest.setTimeout(10000);
|
|
12
12
|
|
|
13
13
|
describe('AppointmentTabs', () => {
|
|
14
14
|
xit(`renders tabs showing different appointment lists`, async () => {
|
|
@@ -53,5 +53,5 @@ describe('AppointmentTabs', () => {
|
|
|
53
53
|
});
|
|
54
54
|
|
|
55
55
|
function renderAppointmentTabs() {
|
|
56
|
-
renderWithSwr(<AppointmentTabs />);
|
|
56
|
+
renderWithSwr(<AppointmentTabs appointmentServiceType="" />);
|
|
57
57
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import userEvent from '@testing-library/user-event';
|
|
3
3
|
import { screen, render } from '@testing-library/react';
|
|
4
|
-
import { mockMappedAppointmentsData } from '../../../../../../__mocks__/appointments.mock';
|
|
5
4
|
import { showNotification, showToast } from '@openmrs/esm-framework';
|
|
6
5
|
import { cancelAppointment } from '../forms.resource';
|
|
6
|
+
import { mockMappedAppointmentsData } from '__mocks__';
|
|
7
7
|
import CancelAppointment from './cancel-appointment.component';
|
|
8
8
|
|
|
9
9
|
const testProps = {
|
|
@@ -185,7 +185,7 @@ const AppointmentForm: React.FC<AppointmentFormProps> = ({ appointment, patientU
|
|
|
185
185
|
id="location"
|
|
186
186
|
invalidText="Required"
|
|
187
187
|
value={selectedLocation}
|
|
188
|
-
|
|
188
|
+
defaultValue={selectedLocation}
|
|
189
189
|
onChange={(event) => setSelectedLocation(event.target.value)}>
|
|
190
190
|
<LocationSelectOption
|
|
191
191
|
selectedLocation={selectedLocation}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { render, screen, within } from '@testing-library/react';
|
|
3
3
|
import { useConfig, usePatient } from '@openmrs/esm-framework';
|
|
4
|
-
import { mockPatient, mockServices, mockProviders } from '
|
|
5
|
-
import { mockLocations } from '../../../../../../__mocks__/locations.mock';
|
|
6
|
-
import { mockSession } from '../../../../../../__mocks__/session.mock';
|
|
4
|
+
import { mockLocations, mockSession, mockPatient, mockServices, mockProviders } from '__mocks__';
|
|
7
5
|
import { MappedAppointment } from '../../../types';
|
|
8
6
|
import AppointmentForm from './appointments-form.component';
|
|
9
7
|
|
|
@@ -43,6 +41,7 @@ const mockedConfig = {
|
|
|
43
41
|
|
|
44
42
|
describe('AppointmentForm', () => {
|
|
45
43
|
const patient = mockPatient;
|
|
44
|
+
|
|
46
45
|
beforeEach(() => {
|
|
47
46
|
mockedUseConfig.mockReturnValue(mockedConfig);
|
|
48
47
|
mockedUsePatient.mockReturnValue({
|
|
@@ -53,23 +52,29 @@ describe('AppointmentForm', () => {
|
|
|
53
52
|
});
|
|
54
53
|
});
|
|
55
54
|
|
|
56
|
-
it('renders details of the correct patient in the patient banner', () => {
|
|
55
|
+
it('renders details of the correct patient in the patient banner', async () => {
|
|
57
56
|
renderAppointmentsForm('creating', mockPatient.uuid);
|
|
58
57
|
|
|
58
|
+
await screen.findByText(/date and time/i);
|
|
59
59
|
expect(screen.getByText(/Date and time/i)).toBeInTheDocument();
|
|
60
60
|
});
|
|
61
61
|
|
|
62
|
-
it('renders the form with all expected inputs in create mode', () => {
|
|
62
|
+
it('renders the form with all expected inputs in create mode', async () => {
|
|
63
63
|
renderAppointmentsForm('creating', mockPatient.uuid);
|
|
64
64
|
|
|
65
|
+
await screen.findByLabelText(/select a location/i);
|
|
66
|
+
|
|
65
67
|
expect(screen.getByRole('combobox', { name: /select a location/i })).toBeInTheDocument();
|
|
66
68
|
expect(screen.getByRole('combobox', { name: /select a service/i })).toBeInTheDocument();
|
|
67
69
|
expect(screen.getByRole('combobox', { name: /select an appointment type/i })).toBeInTheDocument();
|
|
68
70
|
expect(screen.getByRole('combobox', { name: /select a provider/i })).toBeInTheDocument();
|
|
69
71
|
});
|
|
70
72
|
|
|
71
|
-
it('renders the expected appointment types', () => {
|
|
73
|
+
it('renders the expected appointment types', async () => {
|
|
72
74
|
renderAppointmentsForm('creating', mockPatient.uuid);
|
|
75
|
+
|
|
76
|
+
await screen.findByLabelText(/select an appointment type/i);
|
|
77
|
+
|
|
73
78
|
const appointmentTypeSelect = screen.getByLabelText('Select an appointment type');
|
|
74
79
|
|
|
75
80
|
expect(within(appointmentTypeSelect).getAllByRole('option')).toHaveLength(3);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { render, screen } from '@testing-library/react';
|
|
3
3
|
import { openmrsFetch } from '@openmrs/esm-framework';
|
|
4
|
-
import { mockAppointmentMetrics, mockProvidersCount, mockStartTime } from '
|
|
4
|
+
import { mockAppointmentMetrics, mockProvidersCount, mockStartTime } from '__mocks__';
|
|
5
5
|
import AppointmentsMetrics from './appointments-metrics.component';
|
|
6
6
|
|
|
7
7
|
const mockedOpenmrsFetch = openmrsFetch as jest.Mock;
|
|
@@ -36,13 +36,11 @@ describe('Appointment metrics', () => {
|
|
|
36
36
|
|
|
37
37
|
renderAppointmentMetrics();
|
|
38
38
|
|
|
39
|
-
await
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
expect(screen.getByText(/4/i)).toBeInTheDocument();
|
|
45
|
-
});
|
|
39
|
+
await screen.findByText(/appointment metrics/i);
|
|
40
|
+
expect(screen.getByText(/scheduled appointments/i)).toBeInTheDocument();
|
|
41
|
+
expect(screen.getByText(/patients/i)).toBeInTheDocument();
|
|
42
|
+
expect(screen.getByText(/16/i)).toBeInTheDocument();
|
|
43
|
+
expect(screen.getByText(/4/i)).toBeInTheDocument();
|
|
46
44
|
});
|
|
47
45
|
});
|
|
48
46
|
|
|
@@ -2,12 +2,14 @@ import React from 'react';
|
|
|
2
2
|
import { render, screen } from '@testing-library/react';
|
|
3
3
|
import ClinicalAppointments from './appointments.component';
|
|
4
4
|
|
|
5
|
-
describe('
|
|
5
|
+
describe('Clinical Appointments', () => {
|
|
6
6
|
it('should render correctly', () => {
|
|
7
7
|
render(<ClinicalAppointments />);
|
|
8
8
|
|
|
9
|
-
expect(screen.
|
|
10
|
-
expect(screen.
|
|
11
|
-
expect(screen.
|
|
9
|
+
expect(screen.getByTitle(/patient queue illustration/i)).toBeInTheDocument();
|
|
10
|
+
expect(screen.getByText(/^appointments$/i)).toBeInTheDocument();
|
|
11
|
+
expect(screen.getByText(/home/i)).toBeInTheDocument();
|
|
12
|
+
expect(screen.getByPlaceholderText(/DD-MMM-YYYY/i)).toBeInTheDocument();
|
|
13
|
+
expect(screen.getByRole('button', { name: /appointments calendar/i })).toBeInTheDocument();
|
|
12
14
|
});
|
|
13
15
|
});
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { render, screen } from '@testing-library/react';
|
|
3
|
-
import
|
|
4
|
-
import { mockSession } from '../../../../__mocks__/session.mock';
|
|
5
|
-
import { useTodaysAppointments } from './appointments-table.resource';
|
|
3
|
+
import { mockSession } from '__mocks__';
|
|
6
4
|
import { usePagination } from '@openmrs/esm-framework';
|
|
5
|
+
import { useTodaysAppointments } from './appointments-table.resource';
|
|
6
|
+
import AppointmentsBaseTable from './appointments-list.component';
|
|
7
7
|
|
|
8
8
|
const useTodaysAppointmentsMock = useTodaysAppointments as jest.Mock;
|
|
9
9
|
const usePaginationMock = usePagination as jest.Mock;
|
|
@@ -11,7 +11,7 @@ const Overlay: React.FC = () => {
|
|
|
11
11
|
const overlayClass = layout !== 'tablet' ? styles.desktopOverlay : styles.tabletOverlay;
|
|
12
12
|
return (
|
|
13
13
|
<>
|
|
14
|
-
{isOverlayOpen
|
|
14
|
+
{isOverlayOpen ? (
|
|
15
15
|
<div className={overlayClass}>
|
|
16
16
|
{layout === 'tablet' && (
|
|
17
17
|
<Header onClick={() => closeOverlay()} aria-label="Tablet overlay" className={styles.tabletOverlayHeader}>
|
|
@@ -32,7 +32,7 @@ const Overlay: React.FC = () => {
|
|
|
32
32
|
)}
|
|
33
33
|
{component}
|
|
34
34
|
</div>
|
|
35
|
-
)}
|
|
35
|
+
) : null}
|
|
36
36
|
</>
|
|
37
37
|
);
|
|
38
38
|
};
|
package/tsconfig.json
CHANGED