@argusoft/medplat-app-shell 1.0.6 → 1.0.8

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 (264) hide show
  1. package/package.json +139 -141
  2. package/src/GlobalErrorBoundary.jsx +31 -0
  3. package/src/SilentErrorFallback.jsx +68 -0
  4. package/src/TrackingProviderWrapper.jsx +40 -0
  5. package/src/_tests_/__mocks__/MockTranslationProvider.jsx +21 -0
  6. package/src/_tests_/__mocks__/ckeditor.js +45 -0
  7. package/src/_tests_/__mocks__/fileMock.js +1 -0
  8. package/src/_tests_/__mocks__/useranalytics.js +5 -0
  9. package/src/_tests_/views/components/Dashboard/DashboardUI.test.jsx +137 -0
  10. package/src/_tests_/views/components/Dashboard/DashboardUIMock.js +877 -0
  11. package/src/_tests_/views/components/ForgotPassword/ForgotPassword.test.jsx +314 -0
  12. package/src/_tests_/views/components/LocationDirective/LocationDirective.test.jsx.disable +229 -0
  13. package/src/_tests_/views/components/LocationDirective/mockLocationDirective.js +810 -0
  14. package/src/_tests_/views/components/LocationType/MockLocationType.js +42259 -0
  15. package/src/_tests_/views/components/LocationType/addlocationtype.test.jsx.disable +276 -0
  16. package/src/_tests_/views/components/LocationType/editlocationtype.test.jsx.disable +262 -0
  17. package/src/_tests_/views/components/LocationType/locationtype.test.jsx.disable +148 -0
  18. package/src/_tests_/views/components/Profile/UpdateProfileModalData.js +4396 -0
  19. package/src/_tests_/views/components/Profile/updateprofilemodal.test.jsx +282 -0
  20. package/src/_tests_/views/components/SideBar/MockSideBar.js +1379 -0
  21. package/src/_tests_/views/components/SideBar/SideBar.test.jsx +98 -0
  22. package/src/_tests_/views/components/SystemConfig/ManageSystemConfig/AddManageSystemConfig.test.jsx.disable +164 -0
  23. package/src/_tests_/views/components/SystemConfig/ManageSystemConfig/UpdateManageSystemConfig.test.jsx.disable +157 -0
  24. package/src/_tests_/views/components/SystemConfig/MockSystemConfig.js +1280 -0
  25. package/src/_tests_/views/components/SystemConfig/SystemConfig.test.jsx.disable +165 -0
  26. package/src/_tests_/views/components/login/Login.test.jsx +276 -0
  27. package/src/_tests_/views/components/login/MockAuthorise.js +2414 -0
  28. package/src/_tests_/views/components/login/ServiceResponse.js +595 -0
  29. package/src/_tests_/views/components/user/MockManageUser.js +7965 -0
  30. package/src/_tests_/views/components/user/manageuser.test.jsx.disable +989 -0
  31. package/src/_tests_/views/components/user/mockUsersData.js +582 -0
  32. package/src/assets/img/OASISLogin.png +0 -0
  33. package/src/assets/img/bahaarNew.png +0 -0
  34. package/src/assets/img/dnhdd4K.png +0 -0
  35. package/src/assets/img/govtofup.png +0 -0
  36. package/src/assets/img/sewarural4K.png +0 -0
  37. package/src/assets/img/techo4K.png +0 -0
  38. package/src/assets/img/up4K.png +0 -0
  39. package/src/common/HolidayList.jsx +573 -0
  40. package/src/common/MalaciaousInputUtil.js +23 -0
  41. package/src/common/SafeHtml.jsx +17 -0
  42. package/src/common/VersionManager.jsx +109 -0
  43. package/src/common/constants/PerformanceDashboard.js +514 -0
  44. package/src/common/constants/app.constant.js +781 -0
  45. package/src/common/constants/cccVerificationConstants.js +18 -0
  46. package/src/common/constants/fhsrConstant.js +33 -0
  47. package/src/common/constants/gvk-verification.constant.js +76 -0
  48. package/src/common/constants/search.constant.js +23 -0
  49. package/src/common/constants/teleconsulatationConstant.jsx +1339 -0
  50. package/src/common/directives/SearchTemplate.jsx +784 -0
  51. package/src/common/directives/SearchTemplate.scss +14 -0
  52. package/src/common/dynamicView/DynamicView.jsx +353 -0
  53. package/src/common/dynamicView/InputFieldComponent.jsx +1501 -0
  54. package/src/common/dynamicView/InputViewComponent.jsx +298 -0
  55. package/src/common/dynamicView/InputViewComponent.scss +15 -0
  56. package/src/common/env.js +5 -0
  57. package/src/common/filters/locationNameFilter.js +26 -0
  58. package/src/common/fontAwesomeIcons/FontAwesomeIcons.jsx +27 -0
  59. package/src/common/fontAwesomeIcons/FontAwesomeIconsNames.js +1968 -0
  60. package/src/common/fontPreferences/fontSizeProvider.jsx +34 -0
  61. package/src/common/fontPreferences/fontSizeSelector.jsx +116 -0
  62. package/src/common/getAssignedFeature/getAssignedFeature.js +32 -0
  63. package/src/common/interceptors/AxiosInterceptor.js +216 -0
  64. package/src/common/languageTranslator/TranslationContext.js +5 -0
  65. package/src/common/languageTranslator/TranslationProvider.jsx +24 -0
  66. package/src/common/languageTranslator/i18n.js +49 -0
  67. package/src/common/services/AuthenticateService.js +116 -0
  68. package/src/common/services/DownloadFile.js +35 -0
  69. package/src/common/services/ForgotPassword.js +18 -0
  70. package/src/common/services/FormConfiguratorService.js +195 -0
  71. package/src/common/services/GlobalApis.js +84 -0
  72. package/src/common/services/InterceptorNavigationService.js +17 -0
  73. package/src/common/services/LocationService.js +65 -0
  74. package/src/common/services/LocationType.js +11 -0
  75. package/src/common/services/QueryBuilder.js +36 -0
  76. package/src/common/services/Roles.js +28 -0
  77. package/src/common/services/SyncWithServer.js +15 -0
  78. package/src/common/services/SystemConfig.js +15 -0
  79. package/src/common/services/TranslationService.js +70 -0
  80. package/src/common/services/TwoFactorService.js +7 -0
  81. package/src/common/services/Users.js +91 -0
  82. package/src/common/services/Webtasks.js +27 -0
  83. package/src/common/services/util/Convert-pad-data-to-API-format.jsx +167 -0
  84. package/src/common/services/util/Convert-to-UI-format.jsx +82 -0
  85. package/src/common/services/util/EmptyPrescriptionPadData.jsx +11 -0
  86. package/src/common/services/util/GeneralUtil.js +456 -0
  87. package/src/common/services/util/Prescription-pad-util.js +339 -0
  88. package/src/common/services/util/PrescriptionPadData.js +67 -0
  89. package/src/common/services/util/PrescriptionpadCommonUtil.js +96 -0
  90. package/src/common/services/util/ReportFieldUtil.jsx +398 -0
  91. package/src/common/services/util/WebSocketContext.jsx +261 -0
  92. package/src/common/syncWithServer/SyncWithServerDialog.jsx +170 -0
  93. package/src/common/syncWithServer/SyncWithServerDialogSkeleton.jsx +67 -0
  94. package/src/common/tests/CustomWrapper.jsx +49 -0
  95. package/src/common/tests/TranslationWrapper.jsx +38 -0
  96. package/src/common/themeProvider/ColorInputs.jsx +97 -0
  97. package/src/common/themeProvider/EditableColorInput.jsx +128 -0
  98. package/src/common/themeProvider/ThemeEditor.jsx +319 -0
  99. package/src/common/themeProvider/ThemeProvider.jsx +210 -0
  100. package/src/common/themeProvider/themeConfig.js +558 -0
  101. package/src/common/toaster/toaster.jsx +30 -0
  102. package/src/firebaseConfig.js +24 -0
  103. package/src/global.scss +221 -0
  104. package/src/hooks/.gitkeep +0 -0
  105. package/src/hooks/useAESEncryption.js +56 -0
  106. package/src/hooks/useCaching.js +43 -0
  107. package/src/hooks/useDebounce.js +34 -0
  108. package/src/hooks/useDebounceFn.js +50 -0
  109. package/src/hooks/useDownloadPdf.js +358 -0
  110. package/src/hooks/useDownloadXlsx.js +55 -0
  111. package/src/hooks/useListValueFieldValues.js +30 -0
  112. package/src/hooks/useLocationHierarchies.js +63 -0
  113. package/src/hooks/useLocationHierarchyTranslate.js +16 -0
  114. package/src/hooks/useOnline.js +27 -0
  115. package/src/hooks/usePagination.js +63 -0
  116. package/src/hooks/useRefreshToken.js +87 -0
  117. package/src/hooks/useScript.js +25 -0
  118. package/src/hooks/useStopwatch.js +75 -0
  119. package/src/hooks/useTrackEvent.js +22 -0
  120. package/src/hooks/useWebAudioRecorder.js +115 -0
  121. package/src/layout/LoaderComponet.jsx +22 -0
  122. package/src/layout/LoaderContext.jsx +29 -0
  123. package/src/layout/mainLayout/AdaptiveZoom.jsx +27 -0
  124. package/src/layout/mainLayout/Chatbot.jsx +243 -0
  125. package/src/layout/mainLayout/Layout.jsx +445 -0
  126. package/src/layout/mainLayout/Profile/UpdateProfileModal.jsx +684 -0
  127. package/src/layout/mainLayout/header/LogoutModal.jsx +131 -0
  128. package/src/layout/mainLayout/header/Navbar.jsx +1677 -0
  129. package/src/layout/mainLayout/header/Navbar.scss +4 -0
  130. package/src/layout/mainLayout/header/index.js +0 -0
  131. package/src/layout/mainLayout/sidebar/SideBar.jsx +1402 -0
  132. package/src/layout/mainLayout/sidebar/Sidebar.css +159 -0
  133. package/src/layout/mainLayout/sidebar/index.js +0 -0
  134. package/src/logo.svg +1 -0
  135. package/src/reportWebVitals.js +13 -0
  136. package/src/setupFirebaseMessaging.js +28 -0
  137. package/src/setupTests.js +8 -0
  138. package/src/store/actions/AuthenticationActions.js +0 -0
  139. package/src/store/actions/ReportsActions.js +0 -0
  140. package/src/store/actions/TranslationAction.js +0 -0
  141. package/src/store/index.js +8 -0
  142. package/src/store/reducer.js +46 -0
  143. package/src/store/reducers/AuthenticationReducer.js +50 -0
  144. package/src/store/reducers/CalendarEventReducer.js +41 -0
  145. package/src/store/reducers/ConditionClipboardReducer.js +45 -0
  146. package/src/store/reducers/FeatureReducer.js +27 -0
  147. package/src/store/reducers/FormConfiguratorReducer.js +38 -0
  148. package/src/store/reducers/LoadingReducer.js +20 -0
  149. package/src/store/reducers/MembersAuthenticationReducer.js +28 -0
  150. package/src/store/reducers/PrescriptionPadReducer.js +329 -0
  151. package/src/store/reducers/QuestionaireReducer.js +29 -0
  152. package/src/store/reducers/ReportsReducer.js +24 -0
  153. package/src/store/reducers/SkeletonReducer.js +20 -0
  154. package/src/store/reducers/ThemeReducer.js +106 -0
  155. package/src/store/reducers/TranslationReducer.js +126 -0
  156. package/src/store/reducers/dashboardEditorSlice.js +77 -0
  157. package/src/store/reducers/districtHealthDashboardSlice.js +58 -0
  158. package/src/store/reducers/immunizationSlice.js +234 -0
  159. package/src/store/slices/dashboardPagesSlice.js +51 -0
  160. package/src/store/slices/dashboardSlice.js +14 -0
  161. package/src/utils/.gitkeep +0 -0
  162. package/src/utils/FormConstants.js +2629 -0
  163. package/src/utils/GujaratTopoChart.jsx +483 -0
  164. package/src/utils/UUIDgenerator.js +8 -0
  165. package/src/utils/appointment-utils/appointment-utils.js +123 -0
  166. package/src/utils/feature.js +42 -0
  167. package/src/utils/getThemeColor.js +12 -0
  168. package/src/utils/localStorageHelper.js +11 -0
  169. package/src/utils/notifications/enable-push-notifications.js +27 -0
  170. package/src/utils/resolveAppliedStyle.js +11 -0
  171. package/src/utils/themeConfigs.js +1483 -0
  172. package/src/views/custom-components/.gitkeep +0 -0
  173. package/src/views/custom-components/AgIconButton/RIf.jsx +14 -0
  174. package/src/views/custom-components/AgIconButton/button.jsx +108 -0
  175. package/src/views/custom-components/AgIconButton/waterDrop.jsx +95 -0
  176. package/src/views/custom-components/AgIconButton/waterDrop.scss +37 -0
  177. package/src/views/custom-components/AlertPlaceholder.jsx +32 -0
  178. package/src/views/custom-components/AllFaIconsSelector.jsx +56 -0
  179. package/src/views/custom-components/CkEditor/CkEditor.js +102 -0
  180. package/src/views/custom-components/CustomAccordion.jsx +72 -0
  181. package/src/views/custom-components/CustomActionIcons.jsx +118 -0
  182. package/src/views/custom-components/CustomAutoComplete.jsx +188 -0
  183. package/src/views/custom-components/CustomCheckBox.jsx +60 -0
  184. package/src/views/custom-components/CustomConfirmationModal.jsx +118 -0
  185. package/src/views/custom-components/CustomCountrySelect.jsx +129 -0
  186. package/src/views/custom-components/CustomDatePicker.jsx +122 -0
  187. package/src/views/custom-components/CustomDropdown.jsx +191 -0
  188. package/src/views/custom-components/CustomFileUpload.jsx +387 -0
  189. package/src/views/custom-components/CustomFullCalendar.jsx +514 -0
  190. package/src/views/custom-components/CustomInfiniteScroll.jsx +126 -0
  191. package/src/views/custom-components/CustomRadioComponent.jsx +65 -0
  192. package/src/views/custom-components/CustomStatsComponent.jsx +114 -0
  193. package/src/views/custom-components/CustomSvgUpload.jsx +170 -0
  194. package/src/views/custom-components/CustomSwitch.jsx +37 -0
  195. package/src/views/custom-components/CustomTabPanel.jsx +19 -0
  196. package/src/views/custom-components/CustomTextArea.jsx +62 -0
  197. package/src/views/custom-components/CustomTextArea.scss +27 -0
  198. package/src/views/custom-components/CustomTextField.jsx +116 -0
  199. package/src/views/custom-components/CustomToggleSwitch.jsx +138 -0
  200. package/src/views/custom-components/CustomTooltip.jsx +51 -0
  201. package/src/views/custom-components/CustomZoomImage.jsx +134 -0
  202. package/src/views/custom-components/CustomizedTable/CustomizedTableV2.jsx +1407 -0
  203. package/src/views/custom-components/CustomizedTable/VirtualizeTableBody.jsx +295 -0
  204. package/src/views/custom-components/CustomizedTable/helper.jsx +159 -0
  205. package/src/views/custom-components/CustomizedTable.jsx +532 -0
  206. package/src/views/custom-components/EditInputField.jsx +174 -0
  207. package/src/views/custom-components/FieldDescription.jsx +22 -0
  208. package/src/views/custom-components/FileDisplayComponent.jsx +138 -0
  209. package/src/views/custom-components/FormItem.jsx +53 -0
  210. package/src/views/custom-components/GenericChart.jsx +80 -0
  211. package/src/views/custom-components/InfoBadge.jsx +60 -0
  212. package/src/views/custom-components/PostgresEditor.jsx +801 -0
  213. package/src/views/custom-components/ResizableEditAutocompleteField.jsx +249 -0
  214. package/src/views/custom-components/ResizableEditInputField.jsx +215 -0
  215. package/src/views/custom-components/ResizeableEditSelectField.jsx +197 -0
  216. package/src/views/custom-components/SideOverlay.jsx +113 -0
  217. package/src/views/custom-components/SideOverlay.scss +42 -0
  218. package/src/views/custom-components/calendar.scss +571 -0
  219. package/src/views/feature-components/.gitkeep +0 -0
  220. package/src/views/feature-components/Dashboard/DashboardUI.jsx +1043 -0
  221. package/src/views/feature-components/Dashboard/DhnddModal/AshaDataQualityVerificationModal.jsx +278 -0
  222. package/src/views/feature-components/Dashboard/PinFeatureModal.jsx +143 -0
  223. package/src/views/feature-components/Dashboard/QuickLinks.jsx +163 -0
  224. package/src/views/feature-components/Dashboard/Taskbar.jsx +56 -0
  225. package/src/views/feature-components/Dashboard/WebtasksFilterForm.jsx +109 -0
  226. package/src/views/feature-components/Dashboard/WidgetCard.jsx +161 -0
  227. package/src/views/feature-components/Dashboard/actionModal.jsx +263 -0
  228. package/src/views/feature-components/Dashboard/ekavachModal/HealthWorkerIncorrectDetailsModal.jsx +332 -0
  229. package/src/views/feature-components/Dashboard/ekavachModal/MoMaternalDeathVerifcationModal.jsx +275 -0
  230. package/src/views/feature-components/Dashboard/ekavachModal/MoVerficationForChildScreeningMoadal.jsx +566 -0
  231. package/src/views/feature-components/FeatureUsageAnalytics/FeatureUsageAnalytics.jsx +989 -0
  232. package/src/views/feature-components/Features/NewServerManagement.jsx +217 -0
  233. package/src/views/feature-components/Features/ServerManagement.scss +120 -0
  234. package/src/views/feature-components/ForgotPassword/ForgotPassword.jsx +226 -0
  235. package/src/views/feature-components/LocationDirective/LocationDirective.jsx +992 -0
  236. package/src/views/feature-components/LocationDirective/LocationDirectiveV2.jsx +909 -0
  237. package/src/views/feature-components/NotFound.jsx +66 -0
  238. package/src/views/feature-components/Onboarding/Onboarding.jsx +1400 -0
  239. package/src/views/feature-components/Skeletons.js +115 -0
  240. package/src/views/feature-components/Unauthorized.jsx +48 -0
  241. package/src/views/feature-components/VerifyRoute.jsx +88 -0
  242. package/src/views/feature-components/YearlyRecap/YearlyRecap.jsx +357 -0
  243. package/src/views/feature-components/YearlyRecap/components/RecapSlide.jsx +183 -0
  244. package/src/views/feature-components/YearlyRecap/languageTranslator/TranslationContext.js +5 -0
  245. package/src/views/feature-components/YearlyRecap/languageTranslator/TranslationProvider.jsx +26 -0
  246. package/src/views/feature-components/YearlyRecap/languageTranslator/i18n.js +46 -0
  247. package/src/views/feature-components/YearlyRecap/languageTranslator/translations.json +167 -0
  248. package/src/views/feature-components/YearlyRecap/slides/IntroSlide.jsx +233 -0
  249. package/src/views/feature-components/YearlyRecap/slides/MaternalHealthSlide.jsx +146 -0
  250. package/src/views/feature-components/YearlyRecap/slides/MetricSlide.jsx +227 -0
  251. package/src/views/feature-components/YearlyRecap/slides/OutroSlide.jsx +701 -0
  252. package/src/views/feature-components/YearlyRecap/slides/ReachSlide.jsx +273 -0
  253. package/src/views/feature-components/login/Login.jsx +840 -0
  254. package/src/views/feature-components/login/Login.scss +154 -0
  255. package/src/views/feature-components/login/LoginConfigurator.jsx +1149 -0
  256. package/src/views/feature-components/login/TwoFactorSetupModal.jsx +411 -0
  257. package/src/views/feature-components/login/simplifyMenu.js +45 -0
  258. package/src/views/feature-components/system-config/ManageSystemConfigs.jsx +284 -0
  259. package/src/views/feature-components/system-config/SystemConfig.jsx +299 -0
  260. package/src/views/feature-components/users/ChangePasswordModal.jsx +243 -0
  261. package/src/views/feature-components/users/PasswordField.jsx +56 -0
  262. package/dist/index.css +0 -1
  263. package/dist/index.js +0 -32001
  264. package/dist/index.js.map +0 -1
@@ -0,0 +1,276 @@
1
+ import React from 'react';
2
+ import { act, cleanup, fireEvent, render, screen, waitFor } from '@testing-library/react';
3
+ import ManageLocationType from '@/views/feature-components/LocationType/ManageLocationType';
4
+ import { retriveLocationType, createLocationType } from '@/common/services/LocationType';
5
+ import { getRoleList } from '@/common/services/Roles';
6
+ import { mockLocationData, mockRoleTypeData } from '@/_tests_/views/components/LocationType/MockLocationType';
7
+ import { useNavigate } from 'react-router-dom';
8
+ import MockTranslationProvider from '@/_tests_/__mocks__/MockTranslationProvider';
9
+
10
+ jest.mock('../../../../common/services/LocationType', () => ({
11
+ retriveLocationType: jest.fn(),
12
+ createLocationType: jest.fn(),
13
+ getRoleList: jest.fn(),
14
+ }));
15
+
16
+ jest.mock('react-router-dom', () => ({
17
+ ...jest.requireActual('react-router-dom'),
18
+ useNavigate: jest.fn(),
19
+ }));
20
+
21
+ jest.mock('../../../../common/services/Roles', () => ({
22
+ getRoleList: jest.fn(),
23
+ }));
24
+
25
+ jest.mock('react-i18next', () => ({
26
+ useTranslation: () => ({
27
+ t: (key) => key,
28
+ i18n: { changeLanguage: () => new Promise(() => {}) },
29
+ }),
30
+ }));
31
+
32
+ describe('manage location type component', () => {
33
+ beforeEach(() => {
34
+ retriveLocationType.mockResolvedValue(mockLocationData);
35
+ getRoleList.mockResolvedValue(mockRoleTypeData);
36
+ });
37
+
38
+ const renderComponent = async () => {
39
+ await act(async () => {
40
+ render(
41
+ <MockTranslationProvider>
42
+ <ManageLocationType />
43
+ </MockTranslationProvider>
44
+ );
45
+ });
46
+ };
47
+
48
+ afterEach(() => {
49
+ jest.clearAllMocks();
50
+ cleanup();
51
+ });
52
+
53
+ describe('Checking the Element for creating Location Type', () => {
54
+ let mockedNavigate;
55
+ beforeEach(async () => {
56
+ mockedNavigate = jest.fn(); // Create a new mock function for each test
57
+ useNavigate.mockReturnValue(mockedNavigate); // Return the mocked function
58
+ });
59
+ beforeEach(async () => {
60
+ await renderComponent();
61
+ });
62
+ beforeAll(() => {
63
+ jest.setTimeout(20000);
64
+ });
65
+
66
+ it('should check submit button with all fields', async () => {
67
+ let options;
68
+
69
+ const [submitButton, typeInput, nameInput, levelInput] = await Promise.all([
70
+ waitFor(() => screen.getByTestId('managelocationtype-submit-button')),
71
+ waitFor(() => screen.getByTestId('managelocationtype-type-textfield').querySelector('input')),
72
+ waitFor(() => screen.getByTestId('managelocationtype-name-textfield').querySelector('input')),
73
+ waitFor(() => screen.getByTestId('managelocationtype-level-textfield').querySelector('input')),
74
+ ]);
75
+
76
+ expect(typeInput).toBeInTheDocument();
77
+ expect(nameInput).toBeInTheDocument();
78
+ expect(levelInput).toBeInTheDocument();
79
+ expect(submitButton).toBeInTheDocument();
80
+
81
+ fireEvent.change(typeInput, { target: { value: 'State' } });
82
+ fireEvent.change(nameInput, { target: { value: 'gandhinagar' } });
83
+ fireEvent.change(levelInput, { target: { value: '1' } });
84
+
85
+ await Promise.all([
86
+ waitFor(() => expect(typeInput.value).toBe('State')),
87
+ waitFor(() => expect(nameInput.value).toBe('gandhinagar')),
88
+ waitFor(() => expect(levelInput.value).toBe('1')),
89
+ ]);
90
+
91
+ const canAdd = screen.getAllByRole('combobox', { placeholder: /Select some options/i })[0];
92
+ fireEvent.mouseDown(canAdd);
93
+
94
+ const addListboxes = await screen.findAllByRole('listbox'); // Finds all listboxes
95
+ expect(addListboxes).toHaveLength(1); // Ensure only one listbox exists
96
+ const addList = addListboxes[0];
97
+ expect(addList).toBeInTheDocument();
98
+
99
+ options = screen.getAllByRole('option');
100
+ const addRole = options.find((option) => option.getAttribute('data-testid') === 'option-164');
101
+ act(() => {
102
+ addRole.click();
103
+ });
104
+
105
+ const ActionByInputOnAdd = screen.queryAllByRole('button')[0];
106
+ await waitFor(() => {
107
+ expect(screen.queryByRole('listbox')).toBeNull();
108
+ expect(ActionByInputOnAdd).toHaveTextContent('Accountant (Nutrition)');
109
+ });
110
+
111
+ const canDelete = screen.getAllByRole('combobox', { placeholder: /Select some options/i })[1];
112
+ expect(canDelete).toBeInTheDocument();
113
+ fireEvent.mouseDown(canDelete);
114
+
115
+ const deleteListboxes = await screen.findAllByRole('listbox'); // Finds all listboxes
116
+ expect(deleteListboxes).toHaveLength(1); // Ensure only one listbox exists
117
+ const deleteList = deleteListboxes[0];
118
+ expect(deleteList).toBeInTheDocument();
119
+
120
+ options = screen.getAllByRole('option');
121
+ const deleteRole = options.find((option) => option.getAttribute('data-testid') === 'option-164');
122
+ act(() => {
123
+ deleteRole.click();
124
+ });
125
+
126
+ const ActionByInputOnDelete = screen.queryAllByRole('button')[0];
127
+ await waitFor(() => {
128
+ expect(screen.queryByRole('listbox')).toBeNull();
129
+ expect(ActionByInputOnDelete).toHaveTextContent('Accountant (Nutrition)');
130
+ });
131
+
132
+ const canUpdate = screen.getAllByRole('combobox', { placeholder: /Select some options/i })[2];
133
+ expect(canUpdate).toBeInTheDocument();
134
+ fireEvent.mouseDown(canUpdate);
135
+
136
+ const updateListboxes = await screen.findAllByRole('listbox'); // Finds all listboxes
137
+ expect(updateListboxes).toHaveLength(1); // Ensure only one listbox exists
138
+ const updateList = updateListboxes[0];
139
+ expect(updateList).toBeInTheDocument();
140
+
141
+ options = screen.getAllByRole('option');
142
+ const updateRole = options.find((option) => option.getAttribute('data-testid') === 'option-164');
143
+ act(() => {
144
+ updateRole.click();
145
+ });
146
+
147
+ const ActionByInputOnUpdate = screen.queryAllByRole('button')[0];
148
+ await waitFor(() => {
149
+ expect(screen.queryByRole('listbox')).toBeNull();
150
+ expect(ActionByInputOnUpdate).toHaveTextContent('Accountant (Nutrition)');
151
+ });
152
+
153
+ // Submit the form
154
+ fireEvent.submit(submitButton);
155
+ await waitFor(() => {
156
+ expect(createLocationType).toHaveBeenCalledWith({
157
+ code: 'create_location_type',
158
+ parameters: {
159
+ type: 'State',
160
+ name: 'gandhinagar',
161
+ level: 1,
162
+ isSohEnable: true,
163
+ canAdd: '164',
164
+ canUpdate: '164',
165
+ canDelete: '164',
166
+ },
167
+ });
168
+ });
169
+ });
170
+
171
+ it('Checking elements of Manage location type : ', async () => {
172
+ const component = screen.getByTestId('managelocationtype-form');
173
+ expect(component).toBeInTheDocument();
174
+
175
+ const type = screen.getAllByText(/Type/);
176
+ expect(type).toHaveLength(2);
177
+
178
+ const name = screen.getByText(/Name/);
179
+ expect(name).toBeInTheDocument();
180
+
181
+ const level = screen.getByText(/Level/);
182
+ expect(level).toBeInTheDocument();
183
+
184
+ const canUpdate = screen.getByTestId('managelocationtype-canUpdate-select');
185
+ expect(canUpdate).toBeInTheDocument();
186
+
187
+ const canDelete = screen.getByTestId('managelocationtype-canDelete-select');
188
+ expect(canDelete).toBeInTheDocument();
189
+
190
+ const canAdd = screen.getByTestId('managelocationtype-canAdd-select');
191
+ expect(canAdd).toBeInTheDocument();
192
+
193
+ const submitButton = screen.getByTestId('managelocationtype-submit-button');
194
+ expect(submitButton).toBeInTheDocument();
195
+
196
+ const cancelButton = screen.getByTestId('managelocationtype-back-button');
197
+ expect(cancelButton).toBeInTheDocument();
198
+ });
199
+
200
+ it('should check blank submit button', async () => {
201
+ jest.setTimeout(100000);
202
+ let errorMessages;
203
+
204
+ const submitButton = screen.getByTestId('managelocationtype-submit-button');
205
+ const type = screen.getByTestId('managelocationtype-type-textfield');
206
+ const name = screen.getByTestId('managelocationtype-name-textfield');
207
+ const level = screen.getByTestId('managelocationtype-level-textfield');
208
+
209
+ expect(type).toBeInTheDocument();
210
+ expect(name).toBeInTheDocument();
211
+ expect(level).toBeInTheDocument();
212
+ expect(submitButton).toBeInTheDocument();
213
+
214
+ // submit empty form
215
+ const onSubmit = jest.fn();
216
+ fireEvent.click(submitButton);
217
+ await waitFor(() => {
218
+ expect(onSubmit).not.toHaveBeenCalled();
219
+ errorMessages = screen.getAllByTestId('custom-error-message');
220
+ errorMessages = errorMessages.map((msg) => msg.textContent.trim());
221
+
222
+ expect(errorMessages).toHaveLength(2);
223
+ expect(errorMessages).toContain('Please enter location type');
224
+ expect(errorMessages).toContain('Please enter location name');
225
+ });
226
+ });
227
+
228
+ it('should check submit button with only necessary field', async () => {
229
+ jest.setTimeout(100000);
230
+
231
+ const submitButton = screen.getByTestId('managelocationtype-submit-button');
232
+ const type = screen.getByTestId('managelocationtype-type-textfield').querySelector('input');
233
+ const name = screen.getByTestId('managelocationtype-name-textfield').querySelector('input');
234
+ const level = screen.getByTestId('managelocationtype-level-textfield').querySelector('input');
235
+
236
+ expect(type).toBeInTheDocument();
237
+ expect(name).toBeInTheDocument();
238
+ expect(level).toBeInTheDocument();
239
+ expect(submitButton).toBeInTheDocument();
240
+
241
+ fireEvent.change(type, { target: { value: 'State' } });
242
+ fireEvent.change(name, { target: { value: 'gandhinagar' } });
243
+ fireEvent.change(level, { target: { value: '1' } });
244
+
245
+ expect(type.value).toBe('State');
246
+ expect(name.value).toBe('gandhinagar');
247
+ expect(level.value).toBe('1');
248
+
249
+ fireEvent.submit(submitButton);
250
+ await waitFor(() => {
251
+ expect(createLocationType).toHaveBeenCalledWith({
252
+ code: 'create_location_type',
253
+ parameters: {
254
+ type: 'State',
255
+ name: 'gandhinagar',
256
+ level: 1,
257
+ isSohEnable: true,
258
+ canAdd: '',
259
+ canUpdate: '',
260
+ canDelete: '',
261
+ },
262
+ });
263
+ });
264
+ });
265
+
266
+ it('should route on cancel button click', async () => {
267
+ const cancelButton = screen.getByTestId('managelocationtype-back-button');
268
+ expect(cancelButton).toBeInTheDocument();
269
+
270
+ fireEvent.click(cancelButton);
271
+ await waitFor(() => {
272
+ expect(mockedNavigate).toHaveBeenCalledWith('/ui/medplat/manage/locationtype');
273
+ });
274
+ });
275
+ });
276
+ });
@@ -0,0 +1,262 @@
1
+ import React from 'react';
2
+ import { act, cleanup, fireEvent, render, screen, waitFor } from '@testing-library/react';
3
+ import ManageLocationType from '@/views/feature-components/LocationType/ManageLocationType';
4
+ import { retriveLocationType, getLocationTypeById, updateLocationType } from '@/common/services/LocationType';
5
+ import { getRoleList } from '@/common/services/Roles';
6
+ import {
7
+ mockLocationData,
8
+ mockRetrieveData,
9
+ mockRoleTypeData,
10
+ } from '@/_tests_/views/components/LocationType/MockLocationType';
11
+ import { useNavigate } from 'react-router-dom'; // Ensure this is correct import
12
+ import MockTranslationProvider from '@/_tests_/__mocks__/MockTranslationProvider';
13
+
14
+ // Mocking the necessary services and modules
15
+ jest.mock('../../../../common/services/LocationType', () => ({
16
+ retriveLocationType: jest.fn(),
17
+ createLocationType: jest.fn(),
18
+ getLocationTypeById: jest.fn(),
19
+ updateLocationType: jest.fn(),
20
+ }));
21
+
22
+ jest.mock('react-router-dom', () => ({
23
+ ...jest.requireActual('react-router-dom'), // To retain the original module functions
24
+ useNavigate: jest.fn(), // Correctly mock useNavigate
25
+ useParams: jest.fn().mockReturnValue({ id: '1' }), // Uncomment if you need useParams in tests
26
+ }));
27
+
28
+ jest.mock('../../../../common/services/Roles', () => ({
29
+ getRoleList: jest.fn(),
30
+ }));
31
+
32
+ jest.mock('react-i18next', () => ({
33
+ useTranslation: () => ({
34
+ t: (key) => key,
35
+ i18n: { changeLanguage: () => new Promise(() => {}) },
36
+ }),
37
+ }));
38
+
39
+ describe('manage location type component', () => {
40
+ const renderComponent = async () => {
41
+ await act(async () => {
42
+ render(
43
+ <MockTranslationProvider>
44
+ <ManageLocationType />
45
+ </MockTranslationProvider>
46
+ );
47
+ });
48
+ };
49
+
50
+ let mockedNavigate;
51
+ beforeEach(() => {
52
+ mockedNavigate = jest.fn(); // Create a new mock function for each test
53
+ useNavigate.mockReturnValue(mockedNavigate); // Return the mocked function
54
+
55
+ // Mocking resolved values for services
56
+ retriveLocationType.mockResolvedValue(mockLocationData);
57
+ getRoleList.mockResolvedValue(mockRoleTypeData);
58
+ getLocationTypeById.mockResolvedValue(mockRetrieveData);
59
+ });
60
+
61
+ afterEach(() => {
62
+ jest.clearAllMocks();
63
+ cleanup();
64
+ });
65
+
66
+ describe('Checking the Element for creating Location Type', () => {
67
+ beforeEach(async () => {
68
+ await renderComponent();
69
+ });
70
+
71
+ it('Checking elements of Manage location type', async () => {
72
+ // Check that the form elements are rendered correctly
73
+ const component = screen.getByTestId('managelocationtype-form');
74
+ expect(component).toBeInTheDocument();
75
+
76
+ const type = screen.getAllByText(/Type/);
77
+ expect(type).toHaveLength(2);
78
+
79
+ const name = screen.getByText(/Name/);
80
+ expect(name).toBeInTheDocument();
81
+
82
+ const level = screen.getByText(/Level/);
83
+ expect(level).toBeInTheDocument();
84
+
85
+ const submitButton = screen.getByTestId('managelocationtype-submit-button');
86
+ expect(submitButton).toHaveTextContent('Update');
87
+ expect(submitButton).toBeInTheDocument();
88
+
89
+ const cancelButton = screen.getByTestId('managelocationtype-back-button');
90
+ expect(cancelButton).toBeInTheDocument();
91
+ });
92
+
93
+ it('should populate the form with the location type data', async () => {
94
+ await waitFor(() => expect(getLocationTypeById).toHaveBeenCalled());
95
+ expect(getLocationTypeById).toHaveBeenCalledTimes(1);
96
+
97
+ // Wait for the form to be populated with the data
98
+ await waitFor(() => {
99
+ const submitButton = screen.getByTestId('managelocationtype-submit-button');
100
+ const type = screen.getByTestId('managelocationtype-type-textfield').querySelector('input');
101
+ const name = screen.getByTestId('managelocationtype-name-textfield').querySelector('input');
102
+ const level = screen.getByTestId('managelocationtype-level-textfield').querySelector('input');
103
+
104
+ expect(type).toHaveValue('S');
105
+ expect(name).toHaveValue('State');
106
+ expect(level).toHaveValue(1);
107
+ expect(submitButton).toBeInTheDocument();
108
+ });
109
+ });
110
+
111
+ it('should submit the form with the all values ', async () => {
112
+ let options;
113
+
114
+ await waitFor(() => expect(getLocationTypeById).toHaveBeenCalled());
115
+ expect(getLocationTypeById).toHaveBeenCalledTimes(1);
116
+
117
+ // Wait for the form to be populated with the data
118
+ const submitButton = screen.getByTestId('managelocationtype-submit-button');
119
+ const type = screen.getByTestId('managelocationtype-type-textfield').querySelector('input');
120
+ const name = screen.getByTestId('managelocationtype-name-textfield').querySelector('input');
121
+ const level = screen.getByTestId('managelocationtype-level-textfield').querySelector('input');
122
+
123
+ await waitFor(() => {
124
+ expect(type).toHaveValue('S');
125
+ expect(name).toHaveValue('State');
126
+ expect(level).toHaveValue(1);
127
+ expect(submitButton).toBeInTheDocument();
128
+ });
129
+
130
+ const canAdd = screen.getAllByRole('combobox', { placeholder: /Select some options/i })[0];
131
+ await act(async () => {
132
+ fireEvent.mouseDown(canAdd);
133
+ });
134
+
135
+ const addListboxes = await screen.findAllByRole('listbox'); // Finds all listboxes
136
+ expect(addListboxes).toHaveLength(1); // Ensure only one listbox exists
137
+ const addList = addListboxes[0];
138
+ expect(addList).toBeInTheDocument();
139
+
140
+ options = screen.getAllByRole('option');
141
+ const addRole = options.find((option) => option.getAttribute('data-testid') === 'option-164');
142
+ act(() => {
143
+ addRole.click();
144
+ });
145
+
146
+ const ActionByInputOnAdd = screen.queryAllByRole('button')[0];
147
+ await waitFor(() => {
148
+ expect(screen.queryByRole('listbox')).toBeNull();
149
+ expect(ActionByInputOnAdd).toHaveTextContent('Accountant (Nutrition)');
150
+ });
151
+
152
+ const canDelete = screen.getAllByRole('combobox', { placeholder: /Select some options/i })[1];
153
+ expect(canDelete).toBeInTheDocument();
154
+ await act(async () => {
155
+ fireEvent.mouseDown(canDelete);
156
+ });
157
+
158
+ const deleteListboxes = await screen.findAllByRole('listbox'); // Finds all listboxes
159
+ expect(deleteListboxes).toHaveLength(1); // Ensure only one listbox exists
160
+ const deleteList = deleteListboxes[0];
161
+ expect(deleteList).toBeInTheDocument();
162
+
163
+ options = screen.getAllByRole('option');
164
+ const deleteRole = options.find((option) => option.getAttribute('data-testid') === 'option-164');
165
+ act(() => {
166
+ deleteRole.click();
167
+ });
168
+
169
+ const ActionByInputOnDelete = screen.queryAllByRole('button')[0];
170
+ await waitFor(() => {
171
+ expect(screen.queryByRole('listbox')).toBeNull();
172
+ expect(ActionByInputOnDelete).toHaveTextContent('Accountant (Nutrition)');
173
+ });
174
+
175
+ const canUpdate = screen.getAllByRole('combobox', { placeholder: /Select some options/i })[2];
176
+ expect(canUpdate).toBeInTheDocument();
177
+ await act(async () => {
178
+ fireEvent.mouseDown(canUpdate);
179
+ });
180
+
181
+ const updateListboxes = await screen.findAllByRole('listbox'); // Finds all listboxes
182
+ expect(updateListboxes).toHaveLength(1); // Ensure only one listbox exists
183
+ const updateList = updateListboxes[0];
184
+ expect(updateList).toBeInTheDocument();
185
+
186
+ options = screen.getAllByRole('option');
187
+ const updateRole = options.find((option) => option.getAttribute('data-testid') === 'option-164');
188
+ act(() => {
189
+ updateRole.click();
190
+ });
191
+
192
+ const ActionByInputOnUpdate = screen.queryAllByRole('button')[0];
193
+ await waitFor(() => {
194
+ expect(screen.queryByRole('listbox')).toBeNull();
195
+ expect(ActionByInputOnUpdate).toHaveTextContent('Accountant (Nutrition)');
196
+ });
197
+
198
+ // Submit the form
199
+ await act(async () => {
200
+ fireEvent.click(submitButton);
201
+ });
202
+ await waitFor(() => {
203
+ expect(updateLocationType).toHaveBeenCalledWith({
204
+ code: 'update_location_type',
205
+ parameters: {
206
+ type: 'S',
207
+ name: 'State',
208
+ level: 1,
209
+ isSohEnable: true,
210
+ canAdd: '164',
211
+ canUpdate: '164',
212
+ canDelete: '164',
213
+ id: 1,
214
+ },
215
+ });
216
+ });
217
+ }, 100000);
218
+
219
+ it('should check blank submit button', async () => {
220
+ let errorMessages;
221
+
222
+ const submitButton = screen.getByTestId('managelocationtype-submit-button');
223
+ const type = screen.getByTestId('managelocationtype-type-textfield').querySelector('input');
224
+ const name = screen.getByTestId('managelocationtype-name-textfield').querySelector('input');
225
+ const level = screen.getByTestId('managelocationtype-level-textfield').querySelector('input');
226
+
227
+ fireEvent.change(type, { target: { value: '' } });
228
+ fireEvent.change(name, { target: { value: '' } });
229
+ fireEvent.change(level, { target: { value: '' } });
230
+
231
+ await Promise.all([
232
+ waitFor(() => expect(type.value).toBe('')),
233
+ waitFor(() => expect(name.value).toBe('')),
234
+ waitFor(() => expect(level.value).toBe('')),
235
+ ]);
236
+
237
+ // submit empty form
238
+ const onSubmit = jest.fn();
239
+ fireEvent.click(submitButton);
240
+ await waitFor(() => {
241
+ expect(onSubmit).not.toHaveBeenCalled();
242
+ errorMessages = screen.getAllByTestId('custom-error-message');
243
+ errorMessages = errorMessages.map((msg) => msg.textContent.trim());
244
+
245
+ expect(errorMessages).toHaveLength(3);
246
+ expect(errorMessages).toContain('Please enter location type');
247
+ expect(errorMessages).toContain('Please enter location name');
248
+ expect(errorMessages).toContain('Please enter location level');
249
+ });
250
+ });
251
+
252
+ it('should route on cancel button click', async () => {
253
+ const cancelButton = screen.getByTestId('managelocationtype-back-button');
254
+ expect(cancelButton).toBeInTheDocument();
255
+
256
+ fireEvent.click(cancelButton);
257
+ await waitFor(() => {
258
+ expect(mockedNavigate).toHaveBeenCalledWith('/ui/medplat/manage/locationtype');
259
+ });
260
+ });
261
+ });
262
+ });
@@ -0,0 +1,148 @@
1
+ import MockTranslationProvider from '@/_tests_/__mocks__/MockTranslationProvider';
2
+ import { mockLocationData } from '@/_tests_/views/components/LocationType/MockLocationType.js';
3
+ import { retriveLocationType, toggleLocationTypeStatus } from '@/common/services/LocationType.js';
4
+ import LocationType from '@/views/feature-components/LocationType/LocationType.jsx';
5
+ import { cleanup, fireEvent, render, screen, waitFor, within } from '@testing-library/react';
6
+ import React, { act } from 'react';
7
+ import { useNavigate } from 'react-router-dom';
8
+
9
+ jest.mock('../../../../common/services/LocationType.js', () => ({
10
+ retriveLocationType: jest.fn(),
11
+ toggleLocationTypeStatus: jest.fn(),
12
+ }));
13
+
14
+ jest.mock('react-router-dom', () => ({
15
+ ...jest.requireActual('react-router-dom'),
16
+ useNavigate: jest.fn(),
17
+ }));
18
+
19
+ jest.mock('react-i18next', () => ({
20
+ useTranslation: () => ({
21
+ t: (key) => key,
22
+ i18n: { changeLanguage: () => new Promise(() => {}) },
23
+ }),
24
+ }));
25
+
26
+ describe('Location Type', () => {
27
+ const renderComponent = async () => {
28
+ await act(async () => {
29
+ render(
30
+ <MockTranslationProvider>
31
+ <LocationType />
32
+ </MockTranslationProvider>
33
+ );
34
+ });
35
+ };
36
+ let mockedNavigate;
37
+
38
+ beforeEach(async () => {
39
+ mockedNavigate = jest.fn();
40
+ useNavigate.mockImplementation(() => mockedNavigate);
41
+ // Set up mock implementations for service functions
42
+ retriveLocationType.mockResolvedValue(mockLocationData);
43
+ });
44
+
45
+ afterEach(() => {
46
+ jest.clearAllMocks();
47
+ cleanup();
48
+ });
49
+
50
+ describe('Checking the Element present in component', () => {
51
+ beforeEach(async () => {
52
+ await renderComponent();
53
+ });
54
+
55
+ it('should render the Location type Table and checking its length: ', async () => {
56
+ const table = screen.getByTestId('locationtype-customized-table');
57
+ expect(table).toBeInTheDocument();
58
+ const rows = within(table).getAllByRole('row');
59
+ expect(rows.length).toBeGreaterThan(1);
60
+ expect(rows.length).toBe(mockLocationData.data.length + 1);
61
+ });
62
+
63
+ it('should render the Location type Table ', async () => {
64
+ const AddButton = screen.getByTestId('locationtype-add-button');
65
+ expect(AddButton).toBeInTheDocument();
66
+ });
67
+
68
+ it('should render the Header of the table', async () => {
69
+ const title = screen.getByText(/Location Type/);
70
+ expect(title).toBeInTheDocument();
71
+ });
72
+
73
+ it('displays search input and allows searching', async () => {
74
+ const searchInput = screen.getByPlaceholderText(/Search Text/);
75
+ expect(searchInput).toBeInTheDocument();
76
+ });
77
+ });
78
+
79
+ describe('Checking the Function call', () => {
80
+ beforeEach(async () => {
81
+ await renderComponent();
82
+ });
83
+
84
+ it('should call the Search field to search the value in Table', async () => {
85
+ const searchInput = screen.getByPlaceholderText(/Search Text/);
86
+ expect(searchInput).toBeInTheDocument();
87
+
88
+ fireEvent.change(searchInput, { target: { value: 'state' } });
89
+ await new Promise((resolve) => setTimeout(resolve, 1000));
90
+ await waitFor(() => {
91
+ const table = screen.getByTestId('locationtype-customized-table');
92
+ expect(table).toBeInTheDocument();
93
+
94
+ // Get the rows inside the table
95
+ const rows = within(table).getAllByRole('row');
96
+
97
+ expect(rows.length).toBe(2); // Ensure there is at least 1 data row
98
+ expect(rows[1].querySelectorAll('td')[0].textContent).toBe('State');
99
+ expect(rows[1].querySelectorAll('td')[1].textContent).toBe('S');
100
+ });
101
+ });
102
+
103
+ it('should call the Add button to add the new Location Type', async () => {
104
+ const addButton = screen.getByTestId('locationtype-add-button');
105
+ expect(addButton).toBeInTheDocument();
106
+ fireEvent.click(addButton);
107
+ await waitFor(() => {
108
+ expect(mockedNavigate).toHaveBeenCalledWith('/ui/medplat/manage/locationtype/managelocationtype');
109
+ });
110
+ });
111
+
112
+ it('should navigate to manage locationType when edit button is clicked', async () => {
113
+ const editButton = screen.getAllByTestId('EditIcon')[0];
114
+ expect(editButton).toBeInTheDocument();
115
+ fireEvent.click(editButton);
116
+ await waitFor(() => {
117
+ expect(mockedNavigate).toHaveBeenCalledWith('/ui/medplat/manage/locationtype/managelocationtype/1');
118
+ });
119
+ });
120
+
121
+ it('should set location type inactive when Menu button is clicked', async () => {
122
+ const deleteButton = screen.getAllByTestId('MenuIcon')[0];
123
+ expect(deleteButton).toBeInTheDocument();
124
+
125
+ act(() => {
126
+ fireEvent.click(deleteButton);
127
+ });
128
+
129
+ const menuItems = screen.getAllByRole('menuitem');
130
+ expect(menuItems.length).toBe(1);
131
+ act(() => {
132
+ fireEvent.click(menuItems[0]);
133
+ });
134
+ expect(screen.getByTestId('locationtype-confirmation-modal')).toBeInTheDocument();
135
+ const buttonToDelete = screen.getByTestId('locationtype-confirmation-modal-yes-button');
136
+ expect(buttonToDelete).toBeInTheDocument();
137
+ act(() => {
138
+ fireEvent.click(buttonToDelete);
139
+ });
140
+ expect(toggleLocationTypeStatus).toHaveBeenCalledWith({
141
+ code: 'toggle_location_type_status',
142
+ parameters: {
143
+ id: 1,
144
+ },
145
+ });
146
+ });
147
+ });
148
+ });