@kenyaemr/esm-service-queues-app 7.0.3-pre.88 → 7.0.3-pre.94

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.
Files changed (186) hide show
  1. package/.turbo/turbo-build.log +18 -17
  2. package/dist/130.js +1 -1
  3. package/dist/130.js.map +1 -1
  4. package/dist/199.js +1 -1
  5. package/dist/236.js +1 -0
  6. package/dist/236.js.map +1 -0
  7. package/dist/265.js +1 -0
  8. package/dist/265.js.map +1 -0
  9. package/dist/271.js +1 -1
  10. package/dist/282.js +1 -0
  11. package/dist/282.js.map +1 -0
  12. package/dist/319.js +1 -1
  13. package/dist/366.js +1 -0
  14. package/dist/366.js.map +1 -0
  15. package/dist/392.js +1 -0
  16. package/dist/392.js.map +1 -0
  17. package/dist/460.js +1 -1
  18. package/dist/484.js +2 -0
  19. package/dist/484.js.map +1 -0
  20. package/dist/574.js +1 -1
  21. package/dist/6.js +1 -1
  22. package/dist/604.js +1 -0
  23. package/dist/604.js.map +1 -0
  24. package/dist/644.js +1 -1
  25. package/dist/670.js +1 -0
  26. package/dist/670.js.map +1 -0
  27. package/dist/727.js +1 -0
  28. package/dist/727.js.map +1 -0
  29. package/dist/752.js +1 -1
  30. package/dist/757.js +1 -1
  31. package/dist/760.js +1 -0
  32. package/dist/760.js.map +1 -0
  33. package/dist/788.js +1 -1
  34. package/dist/800.js +1 -1
  35. package/dist/807.js +1 -1
  36. package/dist/818.js +1 -0
  37. package/dist/818.js.map +1 -0
  38. package/dist/828.js +1 -1
  39. package/dist/833.js +1 -1
  40. package/dist/911.js +1 -0
  41. package/dist/911.js.map +1 -0
  42. package/dist/kenyaemr-esm-service-queues-app.js +1 -1
  43. package/dist/kenyaemr-esm-service-queues-app.js.buildmanifest.json +160 -160
  44. package/dist/kenyaemr-esm-service-queues-app.js.map +1 -1
  45. package/dist/main.js +1 -1
  46. package/dist/main.js.map +1 -1
  47. package/dist/routes.json +1 -1
  48. package/package.json +1 -1
  49. package/src/active-visits/active-visits-table.resource.ts +1 -1
  50. package/src/active-visits/change-status-dialog.scss +11 -11
  51. package/src/active-visits/change-status-dialog.test.tsx +36 -31
  52. package/src/add-patient-toqueue/add-patient-toqueue-dialog.scss +10 -10
  53. package/src/add-provider-queue-room/add-provider-queue-room.component.tsx +4 -4
  54. package/src/add-provider-queue-room/add-provider-queue-room.resource.ts +2 -2
  55. package/src/add-provider-queue-room/add-provider-queue-room.scss +6 -6
  56. package/src/add-provider-queue-room/add-provider-queue-room.test.tsx +44 -38
  57. package/src/clear-queue-entries-dialog/clear-queue-entries-dialog.component.tsx +1 -1
  58. package/src/clear-queue-entries-dialog/clear-queue-entries-dialog.scss +2 -3
  59. package/src/clear-queue-entries-dialog/clear-queue-entries-dialog.test.tsx +15 -15
  60. package/src/config-schema.ts +84 -84
  61. package/src/current-visit/current-visit-summary.component.tsx +1 -1
  62. package/src/current-visit/current-visit-summary.test.tsx +12 -11
  63. package/src/current-visit/current-visit.resource.ts +1 -1
  64. package/src/current-visit/current-visit.scss +4 -4
  65. package/src/current-visit/hooks/useVitalsConceptMetadata.tsx +1 -1
  66. package/src/current-visit/visit-details/triage-note.scss +11 -11
  67. package/src/helpers/helpers.test.ts +24 -0
  68. package/src/helpers/helpers.ts +41 -14
  69. package/src/home.test.tsx +10 -12
  70. package/src/hooks/useQueueService.ts +16 -10
  71. package/src/past-visit/past-visit-details/past-visit-summary.scss +8 -8
  72. package/src/past-visit/past-visit.component.tsx +1 -1
  73. package/src/past-visit/past-visit.resource.ts +1 -1
  74. package/src/past-visit/past-visit.scss +17 -17
  75. package/src/past-visit/past-visit.test.tsx +8 -13
  76. package/src/patient-info/appointment-details.scss +7 -7
  77. package/src/patient-info/appointment-details.test.tsx +11 -6
  78. package/src/patient-info/appointments.resource.ts +1 -1
  79. package/src/patient-info/patient-info.scss +9 -9
  80. package/src/patient-info/patient-info.test.tsx +3 -14
  81. package/src/patient-queue-header/patient-queue-header.component.tsx +4 -1
  82. package/src/patient-queue-header/patient-queue-header.scss +11 -11
  83. package/src/patient-queue-metrics/clinic-metrics.component.tsx +1 -1
  84. package/src/patient-queue-metrics/clinic-metrics.resource.ts +2 -2
  85. package/src/patient-queue-metrics/clinic-metrics.scss +4 -4
  86. package/src/patient-queue-metrics/clinic-metrics.test.tsx +40 -45
  87. package/src/patient-queue-metrics/metrics-card.scss +11 -11
  88. package/src/patient-queue-metrics/metrics-header.scss +2 -2
  89. package/src/patient-search/advanced-search.scss +27 -27
  90. package/src/patient-search/advanced-search.test.tsx +6 -9
  91. package/src/patient-search/basic-search.scss +14 -14
  92. package/src/patient-search/basic-search.test.tsx +2 -7
  93. package/src/patient-search/hooks/useDefaultLocation.ts +1 -1
  94. package/src/patient-search/hooks/useQueueLocations.tsx +1 -0
  95. package/src/patient-search/hooks/useScheduledVisits.ts +1 -1
  96. package/src/patient-search/patient-scheduled-visits.component.tsx +4 -4
  97. package/src/patient-search/patient-scheduled-visits.scss +17 -17
  98. package/src/patient-search/patient-scheduled-visits.test.tsx +18 -23
  99. package/src/patient-search/patient-search.scss +7 -7
  100. package/src/patient-search/patient-search.workspace.tsx +4 -4
  101. package/src/patient-search/search-results.scss +11 -11
  102. package/src/patient-search/search-results.test.tsx +2 -10
  103. package/src/patient-search/visit-form/visit-form.scss +12 -13
  104. package/src/patient-search/visit-form/visit-type-selector.component.tsx +9 -11
  105. package/src/patient-search/visit-form/visit-type-selector.scss +13 -13
  106. package/src/patient-search/visit-form/visit-type-selector.test.tsx +4 -3
  107. package/src/patient-search/visit-form-queue-fields/visit-form-queue-fields.scss +1 -3
  108. package/src/patient-search/visit-form-queue-fields/visit-form-queue-fields.test.tsx +15 -9
  109. package/src/queue-entry-table-components/edit-entry.scss +1 -1
  110. package/src/queue-entry-table-components/queue-priority.scss +3 -4
  111. package/src/queue-entry-table-components/transition-entry.scss +1 -1
  112. package/src/queue-patient-linelists/queue-linelist-base-table.scss +16 -17
  113. package/src/queue-patient-linelists/queue-linelist-base-table.test.tsx +7 -8
  114. package/src/queue-patient-linelists/queue-linelist-filter.scss +13 -13
  115. package/src/queue-patient-linelists/queue-linelist-filter.test.tsx +9 -6
  116. package/src/queue-patient-linelists/queue-linelist.resource.ts +4 -4
  117. package/src/queue-patient-linelists/scheduled-appointments-table.test.tsx +10 -7
  118. package/src/queue-rooms/queue-room-form.scss +13 -13
  119. package/src/queue-rooms/queue-room-form.test.tsx +10 -8
  120. package/src/queue-screen/queue-screen.scss +6 -4
  121. package/src/queue-screen/queue-screen.test.tsx +6 -6
  122. package/src/queue-services/queue-service-form.scss +13 -13
  123. package/src/queue-services/queue-service-form.test.tsx +15 -8
  124. package/src/queue-table/cells/queue-table-action-cell.component.tsx +2 -2
  125. package/src/queue-table/cells/queue-table-coming-from-cell.component.tsx +1 -1
  126. package/src/queue-table/default-queue-table.component.tsx +63 -61
  127. package/src/queue-table/default-queue-table.test.tsx +61 -61
  128. package/src/queue-table/queue-entry-actions/queue-entry-actions-modal.scss +36 -0
  129. package/src/queue-table/queue-entry-actions/queue-entry-actions.modal.tsx +30 -10
  130. package/src/queue-table/queue-entry-actions/queue-entry-actions.test.tsx +34 -103
  131. package/src/queue-table/queue-entry-actions/queue-entry-confirm-action.test.tsx +42 -25
  132. package/src/queue-table/queue-entry-actions/queue-entry-undo-actions.test.tsx +19 -14
  133. package/src/queue-table/queue-table-by-status-skeleton.component.tsx +1 -5
  134. package/src/queue-table/queue-table-expanded-row.component.tsx +1 -2
  135. package/src/queue-table/queue-table-metrics-card.scss +7 -7
  136. package/src/queue-table/queue-table-metrics.scss +3 -3
  137. package/src/queue-table/queue-table.component.tsx +8 -11
  138. package/src/queue-table/queue-table.scss +32 -26
  139. package/src/queue-table/queue-table.test.tsx +46 -21
  140. package/src/remove-queue-entry-dialog/remove-queue-entry.resource.ts +1 -1
  141. package/src/remove-queue-entry-dialog/remove-queue-entry.scss +2 -2
  142. package/src/remove-queue-entry-dialog/remove-queue-entry.test.tsx +13 -12
  143. package/src/side-menu/side-menu.test.tsx +0 -1
  144. package/src/transition-queue-entry/transition-queue-entry-dialog.component.tsx +1 -1
  145. package/src/transition-queue-entry/transition-queue-entry-dialog.scss +5 -5
  146. package/src/transition-queue-entry/transition-queue-entry-dialog.test.tsx +33 -44
  147. package/src/views/queue-tables-for-all-statuses.component.tsx +14 -14
  148. package/src/visits-missing-inqueue/visits-missing-inqueue.component.tsx +1 -1
  149. package/src/visits-missing-inqueue/visits-missing-inqueue.resource.ts +1 -1
  150. package/src/visits-missing-inqueue/visits-missing-inqueue.scss +17 -14
  151. package/translations/am.json +4 -2
  152. package/translations/ar.json +4 -2
  153. package/translations/en.json +1 -0
  154. package/translations/es.json +4 -2
  155. package/translations/fr.json +39 -37
  156. package/translations/he.json +4 -2
  157. package/translations/km.json +4 -2
  158. package/translations/zh.json +4 -2
  159. package/translations/zh_CN.json +4 -2
  160. package/dist/276.js +0 -1
  161. package/dist/276.js.map +0 -1
  162. package/dist/384.js +0 -2
  163. package/dist/384.js.map +0 -1
  164. package/dist/401.js +0 -1
  165. package/dist/401.js.map +0 -1
  166. package/dist/430.js +0 -1
  167. package/dist/430.js.map +0 -1
  168. package/dist/60.js +0 -1
  169. package/dist/60.js.map +0 -1
  170. package/dist/600.js +0 -1
  171. package/dist/600.js.map +0 -1
  172. package/dist/647.js +0 -1
  173. package/dist/647.js.map +0 -1
  174. package/dist/650.js +0 -1
  175. package/dist/650.js.map +0 -1
  176. package/dist/669.js +0 -1
  177. package/dist/669.js.map +0 -1
  178. package/dist/764.js +0 -1
  179. package/dist/764.js.map +0 -1
  180. package/dist/877.js +0 -1
  181. package/dist/877.js.map +0 -1
  182. package/dist/917.js +0 -1
  183. package/dist/917.js.map +0 -1
  184. package/src/queue-table/queue-entry-actions/queue-entry-actons-modal.scss +0 -36
  185. package/src/root.scss +0 -15
  186. /package/dist/{384.js.LICENSE.txt → 484.js.LICENSE.txt} +0 -0
@@ -1,6 +1,6 @@
1
- @use '@carbon/styles/scss/spacing';
2
- @use '@carbon/styles/scss/type';
3
- @import '~@openmrs/esm-styleguide/src/vars';
1
+ @use '@carbon/layout';
2
+ @use '@carbon/type';
3
+ @use '@openmrs/esm-styleguide/src/vars' as *;
4
4
 
5
5
  .patientChart {
6
6
  text-decoration: none;
@@ -25,9 +25,9 @@
25
25
  }
26
26
 
27
27
  .patientAvatar {
28
- width: spacing.$spacing-11;
29
- height: spacing.$spacing-11;
30
- margin: spacing.$spacing-05 spacing.$spacing-05 0;
28
+ width: layout.$spacing-11;
29
+ height: layout.$spacing-11;
30
+ margin: layout.$spacing-05 layout.$spacing-05 0;
31
31
  border-radius: 1px;
32
32
  }
33
33
 
@@ -35,7 +35,7 @@
35
35
  width: 100%;
36
36
  display: flex;
37
37
  flex-flow: column wrap;
38
- margin: spacing.$spacing-05 0;
38
+ margin: layout.$spacing-05 0;
39
39
  cursor: pointer;
40
40
  }
41
41
 
@@ -51,8 +51,8 @@
51
51
  }
52
52
 
53
53
  .actionsContainer {
54
- padding-top: spacing.$spacing-03;
55
- margin-top: spacing.$spacing-05;
54
+ padding-top: layout.$spacing-03;
55
+ margin-top: layout.$spacing-05;
56
56
  }
57
57
 
58
58
  .sortingCriteriaSelect {
@@ -67,7 +67,7 @@
67
67
  }
68
68
 
69
69
  :global(.cds--list-box__menu-icon) {
70
- height: spacing.$spacing-05;
70
+ height: layout.$spacing-05;
71
71
  }
72
72
 
73
73
  :global(.cds--list-box__menu) {
@@ -75,6 +75,6 @@
75
75
  }
76
76
 
77
77
  :global(.cds--label) {
78
- margin-right: spacing.$spacing-02;
78
+ margin-right: layout.$spacing-02;
79
79
  }
80
80
  }
@@ -3,15 +3,7 @@ import { screen, render } from '@testing-library/react';
3
3
  import { age } from '@openmrs/esm-framework';
4
4
  import SearchResults from './search-results.component';
5
5
 
6
- const mockAge = age as jest.Mock;
7
-
8
- jest.mock('@openmrs/esm-framework', () => {
9
- const originalModule = jest.requireActual('@openmrs/esm-framework');
10
- return {
11
- ...originalModule,
12
- age: jest.fn(),
13
- };
14
- });
6
+ const mockAge = jest.mocked(age);
15
7
 
16
8
  const patients = [
17
9
  {
@@ -63,7 +55,7 @@ const mockToggleSearchType = jest.fn();
63
55
 
64
56
  describe('Search Results', () => {
65
57
  it('should search results page', () => {
66
- mockAge.mockReturnValue(35);
58
+ mockAge.mockReturnValue('35');
67
59
  renderSearchResults();
68
60
  expect(screen.getByText(/John Smith/)).toBeInTheDocument();
69
61
  expect(screen.getByText(/35/)).toBeInTheDocument();
@@ -1,25 +1,24 @@
1
- @use '@carbon/styles/scss/spacing';
2
- @use '@carbon/styles/scss/type';
3
1
  @use '@carbon/layout';
4
- @import '~@openmrs/esm-styleguide/src/vars';
2
+ @use '@carbon/type';
3
+ @use '@openmrs/esm-styleguide/src/vars' as *;
5
4
 
6
5
  .container {
7
6
  flex: 1;
8
7
 
9
8
  & section {
10
- margin: spacing.$spacing-05 spacing.$spacing-05 spacing.$spacing-05;
9
+ margin: layout.$spacing-05 layout.$spacing-05 layout.$spacing-05;
11
10
  }
12
11
  }
13
12
 
14
13
  .heading {
15
14
  @include type.type-style('heading-03');
16
- margin: spacing.$spacing-05;
15
+ margin: layout.$spacing-05;
17
16
  }
18
17
 
19
18
  .sectionTitle {
20
19
  @include type.type-style('heading-compact-02');
21
20
  color: $text-02;
22
- margin-bottom: spacing.$spacing-05;
21
+ margin-bottom: layout.$spacing-05;
23
22
  }
24
23
 
25
24
  .dateTimeSection {
@@ -27,7 +26,7 @@
27
26
  }
28
27
 
29
28
  .radioButton {
30
- margin: spacing.$spacing-05 0;
29
+ margin: layout.$spacing-05 0;
31
30
  }
32
31
 
33
32
  .headerGridRow {
@@ -38,7 +37,7 @@
38
37
  .dataGridRow {
39
38
  display: grid;
40
39
  grid-template-columns: 50% 10% 1fr;
41
- margin: spacing.$spacing-03 spacing.$spacing-05;
40
+ margin: layout.$spacing-03 layout.$spacing-05;
42
41
  width: 100%;
43
42
  }
44
43
 
@@ -50,7 +49,7 @@
50
49
  }
51
50
 
52
51
  .button {
53
- height: 4rem;
52
+ height: layout.$spacing-10;
54
53
  display: flex;
55
54
  align-content: flex-start;
56
55
  align-items: baseline;
@@ -58,14 +57,14 @@
58
57
  }
59
58
 
60
59
  .tabletButtons {
61
- padding: spacing.$spacing-06 spacing.$spacing-05;
62
- margin-top: spacing.$spacing-10;
60
+ padding: layout.$spacing-06 layout.$spacing-05;
61
+ margin-top: layout.$spacing-10;
63
62
  background-color: $ui-02;
64
63
  }
65
64
 
66
65
  .desktopButtons {
67
- padding: 0rem;
68
- margin-top: spacing.$spacing-10;
66
+ padding: 0;
67
+ margin-top: layout.$spacing-10;
69
68
  }
70
69
 
71
70
  @media screen and (max-width: 600px) {
@@ -1,23 +1,21 @@
1
1
  import React, { useState, useMemo, useEffect } from 'react';
2
2
  import classNames from 'classnames';
3
- import debounce from 'lodash-es/debounce';
4
3
  import isEmpty from 'lodash-es/isEmpty';
5
4
  import { useTranslation } from 'react-i18next';
6
- import { Layer, Search, RadioButtonGroup, RadioButton, StructuredListSkeleton, Tile } from '@carbon/react';
7
5
  import {
8
- ResponsiveWrapper,
9
- reportError,
10
- useDebounce,
11
- useLayoutType,
12
- usePagination,
13
- useVisitTypes,
14
- type VisitType,
15
- } from '@openmrs/esm-framework';
6
+ InlineNotification,
7
+ Layer,
8
+ RadioButton,
9
+ RadioButtonGroup,
10
+ Search,
11
+ StructuredListSkeleton,
12
+ Tile,
13
+ } from '@carbon/react';
14
+ import { ResponsiveWrapper, useDebounce, useLayoutType, useVisitTypes, type VisitType } from '@openmrs/esm-framework';
16
15
  import EmptyDataIllustration from '../empty-data-illustration.component';
17
16
  import styles from './visit-type-selector.scss';
18
17
  import { useRecommendedVisitTypes } from '../hooks/useRecommendedVisitTypes';
19
18
  import { type PatientProgram } from '../../types';
20
- import { InlineNotification } from '@carbon/react';
21
19
 
22
20
  export interface VisitTypeSelectorProps {
23
21
  onChange: (event) => void;
@@ -1,9 +1,9 @@
1
- @use '@carbon/styles/scss/spacing';
2
- @use '@carbon/styles/scss/type';
3
- @import '~@openmrs/esm-styleguide/src/vars';
1
+ @use '@carbon/layout';
2
+ @use '@carbon/type';
3
+ @use '@openmrs/esm-styleguide/src/vars' as *;
4
4
 
5
5
  .visitTypeOverviewWrapper {
6
- margin: spacing.$spacing-05 0rem;
6
+ margin: layout.$spacing-05 0;
7
7
  border: 0.0625rem solid $grey-2;
8
8
  }
9
9
 
@@ -31,22 +31,22 @@
31
31
  display: flex;
32
32
  flex-direction: column;
33
33
  align-items: flex-start;
34
- margin-top: spacing.$spacing-03;
35
- min-height: spacing.$spacing-10;
34
+ margin-top: layout.$spacing-03;
35
+ min-height: layout.$spacing-10;
36
36
  width: 100%;
37
37
  @include type.type-style('body-compact-01');
38
38
  }
39
39
 
40
40
  .radioButton {
41
- padding: spacing.$spacing-02 spacing.$spacing-05;
42
- margin: spacing.$spacing-03 0;
41
+ padding: layout.$spacing-02 layout.$spacing-05;
42
+ margin: layout.$spacing-03 0;
43
43
  }
44
44
 
45
45
  .content {
46
46
  @include type.type-style('heading-compact-01');
47
47
  color: $text-02;
48
- margin-top: spacing.$spacing-05;
49
- margin-bottom: spacing.$spacing-03;
48
+ margin-top: layout.$spacing-05;
49
+ margin-bottom: layout.$spacing-03;
50
50
  }
51
51
 
52
52
  .desktopHeading {
@@ -67,12 +67,12 @@
67
67
  .tabletHeading {
68
68
  text-align: left;
69
69
  text-transform: capitalize;
70
- margin-bottom: spacing.$spacing-05;
70
+ margin-bottom: layout.$spacing-05;
71
71
 
72
72
  h4:after {
73
73
  content: '';
74
74
  display: block;
75
- width: 2rem;
75
+ width: layout.$spacing-07;
76
76
  padding-top: 0.188rem;
77
77
  border-bottom: 0.375rem solid var(--brand-03);
78
78
  }
@@ -81,7 +81,7 @@
81
81
  .heading:after {
82
82
  content: '';
83
83
  display: block;
84
- width: 2rem;
84
+ width: layout.$spacing-07;
85
85
  padding-top: 0.188rem;
86
86
  border-bottom: 0.375rem solid var(--brand-03);
87
87
  }
@@ -1,9 +1,10 @@
1
+ /* eslint-disable testing-library/no-node-access */
1
2
  import React from 'react';
2
3
  import userEvent from '@testing-library/user-event';
3
- import { VisitTypeSelector } from './visit-type-selector.component';
4
4
  import { render, screen } from '@testing-library/react';
5
- import { mockPatient, mockVisitTypes } from '__mocks__';
5
+ import { mockVisitTypes } from '__mocks__';
6
6
  import { useVisitTypes } from '@openmrs/esm-framework';
7
+ import { VisitTypeSelector } from './visit-type-selector.component';
7
8
 
8
9
  const mockUseVisitTypes = jest.mocked(useVisitTypes);
9
10
 
@@ -28,7 +29,7 @@ describe('VisitTypeSelector', () => {
28
29
  it('renders the first 5 visit types with a search bar if there are more than 5', () => {
29
30
  render(<VisitTypeSelector onChange={() => {}} />);
30
31
 
31
- expect(screen.queryByRole('searchbox')).toBeInTheDocument();
32
+ expect(screen.getByRole('searchbox')).toBeInTheDocument();
32
33
 
33
34
  mockVisitTypes.slice(0, 5).forEach((visitType) => {
34
35
  const radioButton = screen.getByLabelText(visitType.display);
@@ -1,8 +1,6 @@
1
1
  @use '@carbon/layout';
2
2
  @use '@carbon/type';
3
- @use '@carbon/styles/scss/spacing';
4
-
5
- @import '~@openmrs/esm-styleguide/src/vars';
3
+ @use '@openmrs/esm-styleguide/src/vars' as *;
6
4
 
7
5
  .sectionTitle {
8
6
  @include type.type-style('heading-compact-02');
@@ -1,17 +1,15 @@
1
+ /* eslint-disable testing-library/no-node-access */
1
2
  import React from 'react';
2
3
  import userEvent from '@testing-library/user-event';
3
4
  import { render, screen } from '@testing-library/react';
5
+ import { getDefaultsFromConfigSchema, useConfig, useLayoutType, useSession } from '@openmrs/esm-framework';
6
+ import { configSchema, type ConfigObject } from '../../config-schema';
7
+ import { mockSession } from '__mocks__';
4
8
  import VisitFormQueueFields from './visit-form-queue-fields.component';
5
- import { defineConfigSchema, useLayoutType, useSession } from '@openmrs/esm-framework';
6
- import { configSchema } from '../../config-schema';
7
9
 
8
- defineConfigSchema('@openmrs/esm-service-queues-app', configSchema);
9
-
10
- const mockUseLayoutType = useLayoutType as jest.Mock;
11
- mockUseLayoutType.mockReturnValue('small-desktop');
12
-
13
- const mockUseSession = useSession as jest.Mock;
14
- mockUseSession.mockReturnValue({ sessionLocation: { uuid: '1' } });
10
+ const mockUseConfig = jest.mocked(useConfig<ConfigObject>);
11
+ const mockUseLayoutType = jest.mocked(useLayoutType);
12
+ const mockUseSession = jest.mocked(useSession);
15
13
 
16
14
  jest.mock('../hooks/useQueueLocations', () => ({
17
15
  useQueueLocations: jest.fn(() => ({
@@ -35,6 +33,14 @@ jest.mock('../../hooks/useQueues', () => {
35
33
  });
36
34
 
37
35
  describe('VisitFormQueueFields', () => {
36
+ beforeEach(() => {
37
+ mockUseLayoutType.mockReturnValue('small-desktop');
38
+ mockUseSession.mockReturnValue(mockSession.data);
39
+ mockUseConfig.mockReturnValue({
40
+ ...getDefaultsFromConfigSchema(configSchema),
41
+ });
42
+ });
43
+
38
44
  it('renders the form fields and returns the set values', async () => {
39
45
  const user = userEvent.setup();
40
46
  const setFormFields = jest.fn();
@@ -1,4 +1,4 @@
1
- @import '~@openmrs/esm-styleguide/src/vars';
1
+ @use '@openmrs/esm-styleguide/src/vars' as *;
2
2
 
3
3
  .editIcon {
4
4
  background-color: transparent;
@@ -1,9 +1,8 @@
1
- @use '@carbon/styles/scss/type';
2
- @use '@carbon/styles/scss/spacing';
3
- @import '~@openmrs/esm-styleguide/src/vars';
1
+ @use '@carbon/layout';
2
+ @use '@openmrs/esm-styleguide/src/vars' as *;
4
3
 
5
4
  .tag {
6
- margin: 0.25rem 0;
5
+ margin: layout.$spacing-02 0;
7
6
  white-space: nowrap;
8
7
  }
9
8
 
@@ -1,4 +1,4 @@
1
- @import '~@openmrs/esm-styleguide/src/vars';
1
+ @use '@openmrs/esm-styleguide/src/vars' as *;
2
2
 
3
3
  .callBtn:hover {
4
4
  background-color: transparent;
@@ -1,10 +1,9 @@
1
- @use '@carbon/styles/scss/colors';
2
- @use '@carbon/styles/scss/spacing';
3
- @use '@carbon/styles/scss/type';
4
- @import '~@openmrs/esm-styleguide/src/vars';
1
+ @use '@carbon/layout';
2
+ @use '@carbon/type';
3
+ @use '@openmrs/esm-styleguide/src/vars' as *;
5
4
 
6
5
  .container {
7
- padding-bottom: spacing.$spacing-07;
6
+ padding-bottom: layout.$spacing-07;
8
7
  background-color: $ui-01;
9
8
  }
10
9
 
@@ -16,8 +15,8 @@
16
15
  display: flex;
17
16
  justify-content: space-between;
18
17
  align-items: center;
19
- padding: spacing.$spacing-05;
20
- margin: spacing.$spacing-03;
18
+ padding: layout.$spacing-05;
19
+ margin: layout.$spacing-03;
21
20
  border-top: 1px solid $text-03;
22
21
  border-bottom: 1px solid $text-03;
23
22
  }
@@ -25,19 +24,19 @@
25
24
  .title {
26
25
  @include type.type-style('body-compact-02');
27
26
 
28
- margin: 0 spacing.$spacing-04 spacing.$spacing-04;
27
+ margin: 0 layout.$spacing-04 layout.$spacing-04;
29
28
  }
30
29
 
31
30
  .subTitle {
32
31
  @include type.type-style('label-01');
33
32
  color: $text-02;
34
- margin: spacing.$spacing-01;
35
- margin-left: spacing.$spacing-04;
33
+ margin: layout.$spacing-01;
34
+ margin-left: layout.$spacing-04;
36
35
  }
37
36
 
38
37
  .filterTile {
39
38
  border-bottom: 1px solid $text-03;
40
- margin-bottom: spacing.$spacing-04;
39
+ margin-bottom: layout.$spacing-04;
41
40
  background-color: $ui-01;
42
41
  }
43
42
 
@@ -46,7 +45,7 @@
46
45
  }
47
46
 
48
47
  .tableContainer {
49
- margin: 0 spacing.$spacing-05;
48
+ margin: 0 layout.$spacing-05;
50
49
  padding: 0;
51
50
  }
52
51
 
@@ -66,12 +65,12 @@
66
65
  }
67
66
 
68
67
  tr {
69
- width: spacing.$spacing-01;
68
+ width: layout.$spacing-01;
70
69
  }
71
70
 
72
71
  .toolbarContent {
73
- height: spacing.$spacing-07;
74
- margin-bottom: spacing.$spacing-02;
72
+ height: layout.$spacing-07;
73
+ margin-bottom: layout.$spacing-02;
75
74
  }
76
75
  }
77
76
 
@@ -84,7 +83,7 @@
84
83
  .tileContainer {
85
84
  background-color: $ui-02;
86
85
  border-top: 1px solid $ui-03;
87
- padding: spacing.$spacing-11 0;
86
+ padding: layout.$spacing-11 0;
88
87
  }
89
88
 
90
89
  .tile {
@@ -101,7 +100,7 @@
101
100
  .content {
102
101
  @include type.type-style('heading-compact-02');
103
102
  color: $text-02;
104
- margin-bottom: spacing.$spacing-03;
103
+ margin-bottom: layout.$spacing-03;
105
104
  }
106
105
 
107
106
  .helper {
@@ -38,7 +38,7 @@ const tableHeaders = [
38
38
  },
39
39
  ];
40
40
 
41
- const testProps = {
41
+ const defaultProps = {
42
42
  title: 'Scheduled appointments',
43
43
  patientData: mockMappedAppointmentsData.data,
44
44
  headers: tableHeaders,
@@ -46,13 +46,13 @@ const testProps = {
46
46
  isLoading: false,
47
47
  };
48
48
 
49
- describe('QueuePatientBaseTable: ', () => {
49
+ describe('QueuePatientBaseTable', () => {
50
50
  it('renders a tabular overview of appointments data when available', async () => {
51
51
  const user = userEvent.setup();
52
52
 
53
53
  renderQueueBaseTable();
54
54
 
55
- expect(screen.queryByText(/scheduled appointments/i)).toBeInTheDocument();
55
+ expect(screen.getByText(/scheduled appointments/i)).toBeInTheDocument();
56
56
  const expectedColumnHeaders = [/name/, /return date/, /gender/, /age/, /visit type/, /phone number/];
57
57
  expectedColumnHeaders.forEach((header) => {
58
58
  expect(screen.getByRole('columnheader', { name: new RegExp(header, 'i') })).toBeInTheDocument();
@@ -70,7 +70,7 @@ describe('QueuePatientBaseTable: ', () => {
70
70
  const searchBox = screen.getByRole('searchbox');
71
71
  await user.type(searchBox, 'John');
72
72
 
73
- expect(screen.queryByText(/john wilson/i)).toBeInTheDocument();
73
+ expect(screen.getByText(/john wilson/i)).toBeInTheDocument();
74
74
  expect(screen.queryByText(/eric test ric/i)).not.toBeInTheDocument();
75
75
 
76
76
  await user.clear(searchBox);
@@ -80,14 +80,13 @@ describe('QueuePatientBaseTable: ', () => {
80
80
  });
81
81
 
82
82
  it('renders an empty state view if data is unavailable', async () => {
83
- testProps.patientData = [];
84
- renderQueueBaseTable();
83
+ renderQueueBaseTable({ patientData: [] });
85
84
 
86
85
  expect(screen.getByText(/scheduled appointments/i)).toBeInTheDocument();
87
86
  expect(screen.getByText(/no patients to display/i)).toBeInTheDocument();
88
87
  });
89
88
  });
90
89
 
91
- function renderQueueBaseTable() {
92
- renderWithSwr(<QueuePatientBaseTable {...testProps} />);
90
+ function renderQueueBaseTable(props = {}) {
91
+ renderWithSwr(<QueuePatientBaseTable {...defaultProps} {...props} />);
93
92
  }
@@ -1,30 +1,30 @@
1
- @use '@carbon/styles/scss/type';
2
- @use '@carbon/styles/scss/spacing';
3
- @import '~@openmrs/esm-styleguide/src/vars';
1
+ @use '@carbon/layout';
2
+ @use '@carbon/type';
3
+ @use '@openmrs/esm-styleguide/src/vars' as *;
4
4
 
5
5
  .wrapper {
6
6
  background-color: $ui-02;
7
- padding: spacing.$spacing-06;
7
+ padding: layout.$spacing-06;
8
8
  }
9
9
 
10
10
  .grid {
11
- padding: 0 spacing.$spacing-06 spacing.$spacing-03;
11
+ padding: 0 layout.$spacing-06 layout.$spacing-03;
12
12
  background-color: $ui-01;
13
- margin-bottom: spacing.$spacing-05;
13
+ margin-bottom: layout.$spacing-05;
14
14
  }
15
15
 
16
16
  .heading {
17
17
  color: $text-02;
18
18
  @include type.type-style('heading-compact-02');
19
- margin: spacing.$spacing-04 0 spacing.$spacing-04;
19
+ margin: layout.$spacing-04 0 layout.$spacing-04;
20
20
  }
21
21
 
22
22
  .radioButton {
23
- margin-top: spacing.$spacing-03;
23
+ margin-top: layout.$spacing-03;
24
24
  }
25
25
 
26
26
  .button {
27
- height: spacing.$spacing-10;
27
+ height: layout.$spacing-10;
28
28
  display: flex;
29
29
  align-content: flex-start;
30
30
  align-items: baseline;
@@ -32,20 +32,20 @@
32
32
  }
33
33
 
34
34
  .numberInputs {
35
- margin-top: spacing.$spacing-02;
35
+ margin-top: layout.$spacing-02;
36
36
  display: flex;
37
37
  flex-direction: row;
38
38
  justify-content: space-between;
39
39
  }
40
40
 
41
41
  .tablet {
42
- padding: spacing.$spacing-06 spacing.$spacing-05;
42
+ padding: layout.$spacing-06 layout.$spacing-05;
43
43
  background-color: $ui-02;
44
44
  }
45
45
 
46
46
  .desktop {
47
- padding: 0rem;
48
- margin-top: spacing.$spacing-05;
47
+ padding: 0;
48
+ margin-top: layout.$spacing-05;
49
49
  }
50
50
 
51
51
  .form {
@@ -1,23 +1,26 @@
1
1
  import React from 'react';
2
2
  import userEvent from '@testing-library/user-event';
3
3
  import { render, screen } from '@testing-library/react';
4
+ import { useLayoutType, useVisitTypes } from '@openmrs/esm-framework';
4
5
  import { mockVisitTypes } from '__mocks__';
5
6
  import QueueLinelistFilter from './queue-linelist-filter.workspace';
6
7
 
7
- jest.mock('@openmrs/esm-framework', () => ({
8
- ...jest.requireActual('@openmrs/esm-framework'),
9
- useLayoutType: jest.fn(() => 'tablet'),
10
- useVisitTypes: jest.fn(() => mockVisitTypes),
11
- toOpemrsIsoString: jest.fn(),
12
- }));
8
+ const mockUseLayoutType = jest.mocked(useLayoutType);
9
+ const mockUseVisitTypes = jest.mocked(useVisitTypes);
13
10
 
14
11
  const workspaceProps = {
15
12
  closeWorkspace: jest.fn(),
16
13
  promptBeforeClosing: jest.fn(),
17
14
  closeWorkspaceWithSavedChanges: jest.fn(),
15
+ setTitle: jest.fn(),
18
16
  };
19
17
 
20
18
  describe('QueueLinelistFilter', () => {
19
+ beforeEach(() => {
20
+ mockUseLayoutType.mockReturnValue('tablet');
21
+ mockUseVisitTypes.mockReturnValue(mockVisitTypes);
22
+ });
23
+
21
24
  it('renders the form with filter elements', () => {
22
25
  render(<QueueLinelistFilter {...workspaceProps} />);
23
26
 
@@ -12,7 +12,7 @@ export function useAppointments() {
12
12
  return {
13
13
  appointmentQueueEntries: data ? data?.data : [],
14
14
  isLoading,
15
- isError: error,
15
+ error,
16
16
  isValidating,
17
17
  };
18
18
  }
@@ -25,7 +25,7 @@ export function useCheckedInAppointments() {
25
25
  return {
26
26
  checkedInAppointments: data ? data?.data : [],
27
27
  isLoading,
28
- isError: error,
28
+ error,
29
29
  isValidating,
30
30
  };
31
31
  }
@@ -41,7 +41,7 @@ export function useProviders() {
41
41
  return {
42
42
  providers: data ? data.data?.results : [],
43
43
  isLoading,
44
- isError: error,
44
+ error,
45
45
  isValidating,
46
46
  };
47
47
  }
@@ -77,7 +77,7 @@ export function usePatientAppointments(patientUuid: string, startDate) {
77
77
 
78
78
  return {
79
79
  upcomingAppointment: upcomingAppointments ? upcomingAppointments?.[0] : null,
80
- isError: error,
80
+ error,
81
81
  isLoading,
82
82
  isValidating,
83
83
  };