@openmrs/esm-active-visits-app 10.0.3-pre.8636 → 10.0.3-pre.8644
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/routes.json +1 -1
- package/package.json +6 -5
- package/src/active-visits-widget/active-visits.test.tsx +8 -7
- package/src/visits-summary/visit-detail.test.tsx +5 -4
- package/src/visits-summary/visits-components/encounter-observations.test.tsx +1 -0
- package/vitest.config.ts +4 -0
- package/jest.config.js +0 -3
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"},{"name":"active-visits-tile","slot":"home-metrics-tiles-slot","component":"homeActiveVisitsTile"},{"name":"total-visits-tile","slot":"home-metrics-tiles-slot","component":"homeTotalVisitsTile"}],"pages":[],"version":"10.0.3-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"},{"name":"active-visits-tile","slot":"home-metrics-tiles-slot","component":"homeActiveVisitsTile"},{"name":"total-visits-tile","slot":"home-metrics-tiles-slot","component":"homeTotalVisitsTile"}],"pages":[],"version":"10.0.3-pre.8644"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openmrs/esm-active-visits-app",
|
|
3
|
-
"version": "10.0.3-pre.
|
|
3
|
+
"version": "10.0.3-pre.8644",
|
|
4
4
|
"description": "Active visits widget microfrontend for O3",
|
|
5
5
|
"browser": "dist/openmrs-esm-active-visits-app.js",
|
|
6
6
|
"main": "src/index.ts",
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
"build": "rspack --mode production",
|
|
15
15
|
"analyze": "rspack --mode=production --env.analyze=true",
|
|
16
16
|
"lint": "cross-env eslint src --ext ts,tsx",
|
|
17
|
-
"test": "
|
|
18
|
-
"test:watch": "
|
|
19
|
-
"coverage": "
|
|
17
|
+
"test": "vitest run --passWithNoTests",
|
|
18
|
+
"test:watch": "vitest watch",
|
|
19
|
+
"coverage": "vitest run --coverage --passWithNoTests",
|
|
20
20
|
"typescript": "tsc",
|
|
21
21
|
"extract-translations": "i18next 'src/**/*.component.tsx' 'src/**/*.resource.tsx' 'src/**/*.extension.tsx' 'src/**/*modal.tsx' 'src/**/*.workspace.tsx' 'src/index.ts' --config ../../tools/i18next-parser.config.js"
|
|
22
22
|
},
|
|
@@ -50,7 +50,8 @@
|
|
|
50
50
|
"swr": "2.x"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"openmrs": "next"
|
|
53
|
+
"openmrs": "next",
|
|
54
|
+
"vitest": "^4.1.2"
|
|
54
55
|
},
|
|
55
56
|
"stableVersion": "10.0.2"
|
|
56
57
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { vi, describe, it, expect, test, beforeEach } from 'vitest';
|
|
2
3
|
import userEvent from '@testing-library/user-event';
|
|
3
4
|
import { render, screen } from '@testing-library/react';
|
|
4
5
|
import { getDefaultsFromConfigSchema, type OpenmrsResource, useConfig } from '@openmrs/esm-framework';
|
|
@@ -8,14 +9,14 @@ import { type ActiveVisit, type Observation } from '../types';
|
|
|
8
9
|
import { useActiveVisits, useObsConcepts } from './active-visits.resource';
|
|
9
10
|
import ActiveVisitsTable from './active-visits.component';
|
|
10
11
|
|
|
11
|
-
const mockUseActiveVisits =
|
|
12
|
-
const mockUseObsConcepts =
|
|
13
|
-
const mockUseConfig =
|
|
12
|
+
const mockUseActiveVisits = vi.mocked(useActiveVisits);
|
|
13
|
+
const mockUseObsConcepts = vi.mocked(useObsConcepts);
|
|
14
|
+
const mockUseConfig = vi.mocked(useConfig<ActiveVisitsConfigSchema>);
|
|
14
15
|
|
|
15
|
-
|
|
16
|
-
...
|
|
17
|
-
useActiveVisits:
|
|
18
|
-
useObsConcepts:
|
|
16
|
+
vi.mock('./active-visits.resource', async () => ({
|
|
17
|
+
...((await vi.importActual('./active-visits.resource')) as object),
|
|
18
|
+
useActiveVisits: vi.fn(),
|
|
19
|
+
useObsConcepts: vi.fn(),
|
|
19
20
|
}));
|
|
20
21
|
|
|
21
22
|
const mockObsConcepts: Array<OpenmrsResource> = [
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { vi, describe, it, expect } from 'vitest';
|
|
2
3
|
import userEvent from '@testing-library/user-event';
|
|
3
4
|
import { render, screen } from '@testing-library/react';
|
|
4
5
|
import { useVisit } from './visit.resource';
|
|
5
6
|
import VisitDetailComponent from './visit-detail.component';
|
|
6
7
|
|
|
7
|
-
const mockUseVisit =
|
|
8
|
+
const mockUseVisit = vi.mocked(useVisit);
|
|
8
9
|
const defaultProps = {
|
|
9
10
|
patientUuid: '691eed12-c0f1-11e2-94be-8c13b969e334',
|
|
10
11
|
visitUuid: '497b8b17-54ec-4726-87ec-3c4da8cdcaeb',
|
|
11
12
|
};
|
|
12
13
|
|
|
13
|
-
|
|
14
|
-
...
|
|
15
|
-
useVisit:
|
|
14
|
+
vi.mock('./visit.resource', async () => ({
|
|
15
|
+
...((await vi.importActual('./visit.resource')) as object),
|
|
16
|
+
useVisit: vi.fn(),
|
|
16
17
|
}));
|
|
17
18
|
|
|
18
19
|
describe('VisitDetail', () => {
|
package/vitest.config.ts
ADDED
package/jest.config.js
DELETED