@openmrs/esm-active-visits-app 5.2.2-pre.2411 → 5.2.2-pre.2415
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
CHANGED
package/dist/routes.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"webservices.rest":"^2.2.0"},"extensions":[{"name":"active-visits-widget","slot":"homepage-widgets-slot","component":"activeVisits","order":0},{"name":"visit-summary-widget","slot":"visit-summary-slot","component":"visitDetail"}],"pages":[],"version":"5.2.2-pre.
|
|
1
|
+
{"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"webservices.rest":"^2.2.0"},"extensions":[{"name":"active-visits-widget","slot":"homepage-widgets-slot","component":"activeVisits","order":0},{"name":"visit-summary-widget","slot":"visit-summary-slot","component":"visitDetail"}],"pages":[],"version":"5.2.2-pre.2415"}
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
2
|
+
import userEvent from '@testing-library/user-event';
|
|
3
|
+
import { render, screen } from '@testing-library/react';
|
|
4
|
+
import { usePagination } from '@openmrs/esm-framework';
|
|
5
5
|
import { useActiveVisits } from './active-visits.resource';
|
|
6
|
+
import ActiveVisitsTable from './active-visits.component';
|
|
6
7
|
|
|
7
8
|
const mockedUsePagination = usePagination as jest.Mock;
|
|
8
9
|
const mockActiveVisits = useActiveVisits as jest.Mock;
|
|
@@ -52,7 +53,9 @@ describe('ActiveVisitsTable', () => {
|
|
|
52
53
|
expect(patientNameLink.tagName).toBe('A');
|
|
53
54
|
});
|
|
54
55
|
|
|
55
|
-
it
|
|
56
|
+
it('filters active visits based on search input', async () => {
|
|
57
|
+
const user = userEvent.setup();
|
|
58
|
+
|
|
56
59
|
mockActiveVisits.mockImplementationOnce(() => ({
|
|
57
60
|
activeVisits: [
|
|
58
61
|
{ id: '1', name: 'John Doe', visitType: 'Checkup', patientUuid: 'uuid1' },
|
|
@@ -62,10 +65,11 @@ describe('ActiveVisitsTable', () => {
|
|
|
62
65
|
isValidating: false,
|
|
63
66
|
error: null,
|
|
64
67
|
}));
|
|
68
|
+
|
|
65
69
|
render(<ActiveVisitsTable />);
|
|
66
70
|
|
|
67
71
|
const searchInput = screen.getByPlaceholderText('Filter table');
|
|
68
|
-
|
|
72
|
+
await user.type(searchInput, 'John');
|
|
69
73
|
|
|
70
74
|
expect(screen.getByText('John Doe')).toBeInTheDocument();
|
|
71
75
|
expect(screen.queryByText('Some One')).toBeNull();
|