@m4l/testing 0.0.24 → 1.0.1

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 (235) hide show
  1. package/README.md +679 -0
  2. package/chunks/reactLeaflet-Cffkauof.js +1846 -0
  3. package/chunks/render-CsuV8xqo.js +17 -0
  4. package/chunks/userPreferences-BmOgRaIX.js +493 -0
  5. package/index.js +76 -25
  6. package/mocks/index.js +41 -0
  7. package/package.json +84 -69
  8. package/playwright/index.js +2041 -0
  9. package/rtl/index.js +180 -0
  10. package/types/libs/observability/mf/src/browserRuntimeHandles.d.ts +112 -0
  11. package/types/libs/observability/mf/src/diagnosticLogging.d.ts +2 -0
  12. package/types/libs/observability/mf/src/diagnosticPolicies/catalog.d.ts +267 -0
  13. package/types/libs/observability/mf/src/diagnosticPolicies/contracts.d.ts +64 -0
  14. package/types/libs/observability/mf/src/diagnosticPolicies/host.d.ts +139 -0
  15. package/types/libs/observability/mf/src/diagnosticPolicies/index.d.ts +6 -0
  16. package/types/libs/observability/mf/src/diagnosticPolicies/operativeMyGpsDevices.d.ts +104 -0
  17. package/types/libs/observability/mf/src/diagnosticPolicies/sharedReportsList.d.ts +44 -0
  18. package/types/libs/observability/mf/src/diagnosticPolicyKeys.d.ts +34 -0
  19. package/types/libs/observability/mf/src/index.d.ts +14 -0
  20. package/types/libs/observability/mf/src/runtimeSmoke.d.ts +13 -0
  21. package/types/libs/observability/mf/src/telemetry.d.ts +2 -0
  22. package/types/libs/observability/shared/src/diagnosticLogging.d.ts +97 -0
  23. package/types/libs/observability/shared/src/index.d.ts +6 -0
  24. package/types/libs/observability/shared/src/runtimeHandles.d.ts +27 -0
  25. package/types/libs/observability/shared/src/telemetry.d.ts +179 -0
  26. package/types/packages/testing/mocks/src/constants.d.ts +10 -0
  27. package/types/packages/testing/mocks/src/fixtures.d.ts +258 -0
  28. package/types/packages/testing/mocks/src/helpers/environment.d.ts +44 -0
  29. package/types/packages/testing/mocks/src/helpers/hostTools.d.ts +10 -0
  30. package/types/packages/testing/mocks/src/helpers/index.d.ts +5 -0
  31. package/types/packages/testing/mocks/src/helpers/moduleDictionary.d.ts +9 -0
  32. package/types/packages/testing/mocks/src/helpers/toaster.d.ts +9 -0
  33. package/types/packages/testing/mocks/src/helpers/userPreferences.d.ts +17 -0
  34. package/types/packages/testing/mocks/src/index.d.ts +4 -0
  35. package/types/packages/testing/mocks/src/types.d.ts +233 -0
  36. package/types/packages/testing/playwright/src/fixtures/createHostAreaFixture.d.ts +5 -0
  37. package/types/packages/testing/playwright/src/fixtures/createHostAuthenticatedMfMenuFixture.d.ts +5 -0
  38. package/types/packages/testing/playwright/src/fixtures/createHostAuthenticatedMfModuleDictionaryFixture.d.ts +5 -0
  39. package/types/packages/testing/playwright/src/fixtures/createHostAuthenticatedSessionFixture.d.ts +6 -0
  40. package/types/packages/testing/playwright/src/fixtures/createHostCookieFixture.d.ts +5 -0
  41. package/types/packages/testing/playwright/src/fixtures/createHostGuestSessionFixture.d.ts +5 -0
  42. package/types/packages/testing/playwright/src/fixtures/createHostLocaleFixture.d.ts +5 -0
  43. package/types/packages/testing/playwright/src/fixtures/createHostMfPreviewDynamicParamsFixture.d.ts +5 -0
  44. package/types/packages/testing/playwright/src/fixtures/createHostModuleDictionaryFixture.d.ts +11 -0
  45. package/types/packages/testing/playwright/src/fixtures/createHostUiConfigFixture.d.ts +7 -0
  46. package/types/packages/testing/playwright/src/fixtures/createHostUserPreferencesFixture.d.ts +6 -0
  47. package/types/packages/testing/playwright/src/fixtures/createListResponseFixture.d.ts +6 -0
  48. package/types/packages/testing/playwright/src/fixtures/index.d.ts +12 -0
  49. package/types/packages/testing/playwright/src/helpers/attachJson.d.ts +9 -0
  50. package/types/packages/testing/playwright/src/helpers/formAccess.d.ts +53 -0
  51. package/types/packages/testing/playwright/src/helpers/formSelect.d.ts +51 -0
  52. package/types/packages/testing/playwright/src/helpers/formatFailedChecks.d.ts +18 -0
  53. package/types/packages/testing/playwright/src/helpers/index.d.ts +16 -0
  54. package/types/packages/testing/playwright/src/helpers/listDatagrid.d.ts +219 -0
  55. package/types/packages/testing/playwright/src/helpers/listDetail.d.ts +65 -0
  56. package/types/packages/testing/playwright/src/helpers/listFilter.d.ts +27 -0
  57. package/types/packages/testing/playwright/src/helpers/listSort.d.ts +19 -0
  58. package/types/packages/testing/playwright/src/helpers/listStatePersistence.d.ts +15 -0
  59. package/types/packages/testing/playwright/src/helpers/openHostAccountMenuModule.d.ts +10 -0
  60. package/types/packages/testing/playwright/src/helpers/openHostAuthenticatedMfPreviewModule.d.ts +5 -0
  61. package/types/packages/testing/playwright/src/helpers/openHostMobileSidebarModule.d.ts +15 -0
  62. package/types/packages/testing/playwright/src/helpers/openHostSidebarModule.d.ts +5 -0
  63. package/types/packages/testing/playwright/src/helpers/realtimePerformanceBrowser.d.ts +144 -0
  64. package/types/packages/testing/playwright/src/helpers/viewModeDataGrid.d.ts +67 -0
  65. package/types/packages/testing/playwright/src/helpers/waitForBrowserCondition.d.ts +38 -0
  66. package/types/packages/testing/playwright/src/index.d.ts +11 -0
  67. package/types/packages/testing/playwright/src/installers/index.d.ts +20 -0
  68. package/types/packages/testing/playwright/src/installers/installHostAlarmsCountRoute.d.ts +5 -0
  69. package/types/packages/testing/playwright/src/installers/installHostAreasRoute.d.ts +5 -0
  70. package/types/packages/testing/playwright/src/installers/installHostAuthenticatedBootstrapRoutes.d.ts +6 -0
  71. package/types/packages/testing/playwright/src/installers/installHostAuthenticatedMfModuleDictionaryRoute.d.ts +5 -0
  72. package/types/packages/testing/playwright/src/installers/installHostAuthenticatedMfPreviewBootstrap.d.ts +11 -0
  73. package/types/packages/testing/playwright/src/installers/installHostAuthenticatedSessionRoute.d.ts +6 -0
  74. package/types/packages/testing/playwright/src/installers/installHostCookiesRoute.d.ts +8 -0
  75. package/types/packages/testing/playwright/src/installers/installHostGuestBootstrapRoutes.d.ts +7 -0
  76. package/types/packages/testing/playwright/src/installers/installHostGuestSessionRoute.d.ts +7 -0
  77. package/types/packages/testing/playwright/src/installers/installHostLocaleRoute.d.ts +5 -0
  78. package/types/packages/testing/playwright/src/installers/installHostMenusRoute.d.ts +11 -0
  79. package/types/packages/testing/playwright/src/installers/installHostModuleDictionaryRoute.d.ts +6 -0
  80. package/types/packages/testing/playwright/src/installers/installHostPasswordNewRoute.d.ts +6 -0
  81. package/types/packages/testing/playwright/src/installers/installHostPasswordResetRoute.d.ts +6 -0
  82. package/types/packages/testing/playwright/src/installers/installHostUiConfigAssetRoutes.d.ts +9 -0
  83. package/types/packages/testing/playwright/src/installers/installHostUiConfigRoute.d.ts +7 -0
  84. package/types/packages/testing/playwright/src/installers/installHostUserPreferencesRoute.d.ts +6 -0
  85. package/types/packages/testing/playwright/src/installers/installListEndpointRoute.d.ts +7 -0
  86. package/types/packages/testing/playwright/src/installers/installMicrofrontendRenderStub.d.ts +9 -0
  87. package/types/packages/testing/playwright/src/installers/installModulePrivilegesRoute.d.ts +11 -0
  88. package/types/packages/testing/playwright/src/types.d.ts +598 -0
  89. package/types/packages/testing/rtl/src/index.d.ts +4 -0
  90. package/types/packages/testing/rtl/src/matchMedia.d.ts +10 -0
  91. package/types/packages/testing/rtl/src/render.d.ts +17 -0
  92. package/types/packages/testing/rtl/src/resizeObserver.d.ts +33 -0
  93. package/types/packages/testing/rtl/src/storage.d.ts +10 -0
  94. package/types/packages/testing/src/index.d.ts +6 -0
  95. package/types/packages/testing/vitest/src/constants.d.ts +24 -0
  96. package/types/packages/testing/vitest/src/factories/app/index.d.ts +5 -0
  97. package/types/packages/testing/vitest/src/factories/app/m4lAppBase.d.ts +9 -0
  98. package/types/packages/testing/vitest/src/factories/app/m4lAppComponents.d.ts +20 -0
  99. package/types/packages/testing/vitest/src/factories/app/m4lAppCore.d.ts +12 -0
  100. package/types/packages/testing/vitest/src/factories/app/m4lAppGraphics.d.ts +10 -0
  101. package/types/packages/testing/vitest/src/factories/app/m4lAppLayouts.d.ts +18 -0
  102. package/types/packages/testing/vitest/src/factories/base/index.d.ts +1 -0
  103. package/types/packages/testing/vitest/src/factories/base/m4lBaseComponents.d.ts +13 -0
  104. package/types/packages/testing/vitest/src/factories/index.d.ts +7 -0
  105. package/types/packages/testing/vitest/src/factories/leaflet.d.ts +10 -0
  106. package/types/packages/testing/vitest/src/factories/packages/index.d.ts +7 -0
  107. package/types/packages/testing/vitest/src/factories/packages/m4lPackageBase.d.ts +11 -0
  108. package/types/packages/testing/vitest/src/factories/packages/m4lPackageComponents.d.ts +11 -0
  109. package/types/packages/testing/vitest/src/factories/packages/m4lPackageCore.d.ts +11 -0
  110. package/types/packages/testing/vitest/src/factories/packages/m4lPackageGclick.d.ts +10 -0
  111. package/types/packages/testing/vitest/src/factories/packages/m4lPackageGclickRealtime.d.ts +6 -0
  112. package/types/packages/testing/vitest/src/factories/packages/m4lPackageGraphics.d.ts +9 -0
  113. package/types/packages/testing/vitest/src/factories/packages/m4lPackageLayouts.d.ts +10 -0
  114. package/types/packages/testing/vitest/src/factories/reResizable.d.ts +6 -0
  115. package/types/packages/testing/vitest/src/factories/reactHookForm.d.ts +10 -0
  116. package/types/packages/testing/vitest/src/factories/reactLeaflet.d.ts +10 -0
  117. package/types/packages/testing/vitest/src/fixtures.d.ts +71 -0
  118. package/types/packages/testing/vitest/src/helpers/columnConfigs.d.ts +184 -0
  119. package/types/packages/testing/vitest/src/helpers/elementMocks.d.ts +166 -0
  120. package/types/packages/testing/vitest/src/helpers/filterFields.d.ts +37 -0
  121. package/types/packages/testing/vitest/src/helpers/index.d.ts +9 -0
  122. package/types/packages/testing/vitest/src/helpers/mapStore.d.ts +9 -0
  123. package/types/packages/testing/vitest/src/helpers/moduleContract.d.ts +15 -0
  124. package/types/packages/testing/vitest/src/helpers/rhf.d.ts +8 -0
  125. package/types/packages/testing/vitest/src/helpers/serialization.d.ts +7 -0
  126. package/types/packages/testing/vitest/src/helpers/sortFields.d.ts +28 -0
  127. package/types/packages/testing/vitest/src/helpers/windowSizes.d.ts +1 -0
  128. package/types/packages/testing/vitest/src/index.d.ts +6 -0
  129. package/types/packages/testing/vitest/src/installers/consoleError.d.ts +9 -0
  130. package/types/packages/testing/vitest/src/installers/index.d.ts +2 -0
  131. package/types/packages/testing/vitest/src/installers/rhfSubmit.d.ts +9 -0
  132. package/types/packages/testing/vitest/src/types.d.ts +116 -0
  133. package/vitest/index.js +55 -0
  134. package/e2e/commands/components/Accordions/commands.d.ts +0 -4
  135. package/e2e/commands/components/Accordions/commands.js +0 -19
  136. package/e2e/commands/components/Accordions/types.d.ts +0 -63
  137. package/e2e/commands/components/CommonActions/commands.d.ts +0 -4
  138. package/e2e/commands/components/CommonActions/commands.js +0 -11
  139. package/e2e/commands/components/CommonActions/types.d.ts +0 -20
  140. package/e2e/commands/components/DataGrid/commands.d.ts +0 -4
  141. package/e2e/commands/components/DataGrid/commands.js +0 -42
  142. package/e2e/commands/components/DataGrid/types.d.ts +0 -140
  143. package/e2e/commands/components/DynamicFilter/commands.d.ts +0 -4
  144. package/e2e/commands/components/DynamicFilter/commands.js +0 -12
  145. package/e2e/commands/components/DynamicFilter/types.d.ts +0 -27
  146. package/e2e/commands/components/DynamicSort/commands.d.ts +0 -4
  147. package/e2e/commands/components/DynamicSort/commands.js +0 -10
  148. package/e2e/commands/components/DynamicSort/types.d.ts +0 -26
  149. package/e2e/commands/components/Filters/commands.d.ts +0 -4
  150. package/e2e/commands/components/Filters/commands.js +0 -24
  151. package/e2e/commands/components/Filters/types.d.ts +0 -91
  152. package/e2e/commands/components/Form/commands.d.ts +0 -4
  153. package/e2e/commands/components/Form/commands.js +0 -11
  154. package/e2e/commands/components/Form/cypress/assertInitialFormState/assertInitialFormState.d.ts +0 -5
  155. package/e2e/commands/components/Form/cypress/assertInitialFormState/assertInitialFormState.js +0 -20
  156. package/e2e/commands/components/Form/cypress/assertInitialFormState/type.d.ts +0 -105
  157. package/e2e/commands/components/Form/cypress/assertInitialFormState/type.js +0 -1
  158. package/e2e/commands/components/Form/cypress/assertMandatoryFields/assertMandatoryFields.d.ts +0 -17
  159. package/e2e/commands/components/Form/cypress/assertMandatoryFields/assertMandatoryFields.js +0 -14
  160. package/e2e/commands/components/Form/cypress/assertMandatoryFields/type.d.ts +0 -28
  161. package/e2e/commands/components/Form/cypress/assertMandatoryFields/type.js +0 -1
  162. package/e2e/commands/components/Form/cypress/constants.d.ts +0 -3
  163. package/e2e/commands/components/Form/cypress/constants.js +0 -6
  164. package/e2e/commands/components/Form/cypress/fillAndAssertFormFields/fillAndAssertFormFields.d.ts +0 -8
  165. package/e2e/commands/components/Form/cypress/fillAndAssertFormFields/fillAndAssertFormFields.js +0 -29
  166. package/e2e/commands/components/Form/cypress/fillAndAssertFormFields/type.d.ts +0 -5
  167. package/e2e/commands/components/Form/cypress/fillAndAssertFormFields/type.js +0 -1
  168. package/e2e/commands/components/Form/cypress/getFormScope/getFormScope.d.ts +0 -20
  169. package/e2e/commands/components/Form/cypress/getFormScope/getFormScope.js +0 -8
  170. package/e2e/commands/components/Form/cypress/proceedFormStep/proceedFormStep.d.ts +0 -10
  171. package/e2e/commands/components/Form/cypress/proceedFormStep/proceedFormStep.js +0 -6
  172. package/e2e/commands/components/Form/cypress/proceedFormStep/type.d.ts +0 -13
  173. package/e2e/commands/components/Form/helpers/getFieldNameDomElement.d.ts +0 -7
  174. package/e2e/commands/components/Form/helpers/getFieldNameDomElement.js +0 -13
  175. package/e2e/commands/components/Form/types.d.ts +0 -88
  176. package/e2e/commands/components/MenuActions/commands.d.ts +0 -4
  177. package/e2e/commands/components/MenuActions/commands.js +0 -8
  178. package/e2e/commands/components/MenuActions/types.d.ts +0 -24
  179. package/e2e/commands/components/Popover/commands.d.ts +0 -4
  180. package/e2e/commands/components/Popover/commands.js +0 -8
  181. package/e2e/commands/components/Popover/types.d.ts +0 -15
  182. package/e2e/commands/components/PropertyValue/commands.d.ts +0 -4
  183. package/e2e/commands/components/PropertyValue/commands.js +0 -8
  184. package/e2e/commands/components/PropertyValue/types.d.ts +0 -19
  185. package/e2e/commands/components/Tab/commands.d.ts +0 -4
  186. package/e2e/commands/components/Tab/commands.js +0 -9
  187. package/e2e/commands/components/Tab/types.d.ts +0 -29
  188. package/e2e/commands/components/WindowBase/commands.d.ts +0 -4
  189. package/e2e/commands/components/WindowBase/commands.js +0 -24
  190. package/e2e/commands/components/WindowBase/types.d.ts +0 -100
  191. package/e2e/commands/components/index.d.ts +0 -12
  192. package/e2e/commands/components/index.js +0 -1
  193. package/e2e/commands/index.d.ts +0 -7
  194. package/e2e/commands/index.js +0 -1
  195. package/e2e/commands/intercepts/index.d.ts +0 -2
  196. package/e2e/commands/intercepts/index.js +0 -1
  197. package/e2e/commands/intercepts/noPrivileges/interceptCommands.d.ts +0 -5
  198. package/e2e/commands/intercepts/noPrivileges/interceptCommands.js +0 -15
  199. package/e2e/commands/intercepts/noPrivileges/types.d.ts +0 -8
  200. package/e2e/commands/intercepts/noPrivileges/types.js +0 -1
  201. package/e2e/commands/register.d.ts +0 -4
  202. package/e2e/commands/register.js +0 -19
  203. package/e2e/cypress.d.js +0 -1
  204. package/e2e/cypress.d.ts +0 -24
  205. package/e2e/index.d.ts +0 -1
  206. package/e2e/types.d.ts +0 -4
  207. package/index.d.ts +0 -4
  208. package/index.test.d.ts +0 -1
  209. package/testComponents/DataGrid/helpers.d.ts +0 -5
  210. package/testComponents/DataGrid/helpers.js +0 -95
  211. package/testComponents/DataGrid/index.d.ts +0 -2
  212. package/testComponents/DataGrid/index.js +0 -1
  213. package/testComponents/DataGrid/types.d.ts +0 -54
  214. package/testComponents/DataGrid/types.js +0 -1
  215. package/testComponents/DynamicFilter/helpers.d.ts +0 -5
  216. package/testComponents/DynamicFilter/helpers.js +0 -18
  217. package/testComponents/DynamicFilter/index.d.ts +0 -1
  218. package/testComponents/DynamicFilter/index.js +0 -1
  219. package/testComponents/DynamicFilter/types.d.ts +0 -0
  220. package/testComponents/DynamicSort/helpers.d.ts +0 -5
  221. package/testComponents/DynamicSort/helpers.js +0 -16
  222. package/testComponents/DynamicSort/index.d.ts +0 -1
  223. package/testComponents/DynamicSort/index.js +0 -1
  224. package/testComponents/index.d.ts +0 -3
  225. package/testComponents/index.js +0 -1
  226. package/testTools/constants.d.ts +0 -0
  227. package/testTools/index.d.ts +0 -1
  228. package/testTools/index.js +0 -1
  229. package/testTools/mocks.d.ts +0 -0
  230. package/testTools/setup.d.ts +0 -0
  231. package/testTools/setup.js +0 -1
  232. package/testTools/types.d.ts +0 -0
  233. package/testTools/utils.d.ts +0 -11
  234. package/testTools/utils.js +0 -23
  235. package/vite-env.d.ts +0 -5
@@ -0,0 +1,598 @@
1
+ import type { Page } from '@playwright/test';
2
+ /**
3
+ * Shared UI-config payload shape used by host-style Playwright mocks.
4
+ * Keep this contract local to the testing library so app E2E projects can
5
+ * reuse the shape without importing runtime-only app types.
6
+ */
7
+ export interface HostUIConfigFixture {
8
+ privacyPolicyLink: string;
9
+ useTerms: string;
10
+ assetLogoUrl: string;
11
+ assetUserInterfaceLogoUrl: string;
12
+ assetDocumentsLogoUrl: string;
13
+ assetNotificationsLogoUrl: string;
14
+ assetLoginBackgroundUrl: string;
15
+ assetFaviconUrl: string;
16
+ assetLogoMobileUrl: string;
17
+ browserName: string;
18
+ bottomTitle: string;
19
+ dbType: 'dt_main' | 'dt_admin' | 'dt_operative';
20
+ }
21
+ /**
22
+ * Locale payload returned by the host locale bootstrap endpoint.
23
+ */
24
+ export interface HostLocaleFixture {
25
+ lang: string;
26
+ script?: string;
27
+ region?: string;
28
+ urlIcon: string;
29
+ name: string;
30
+ }
31
+ /**
32
+ * Minimal module-dictionary payload shape accepted by the shared dictionary
33
+ * provider. Keep the shape broad enough for app-local dictionaries to add
34
+ * extra sections when needed.
35
+ */
36
+ export interface HostModuleDictionaryFixture {
37
+ data: Record<string, string>;
38
+ [section: string]: unknown;
39
+ }
40
+ /**
41
+ * Response body used by the guest session bootstrap route.
42
+ */
43
+ export interface HostGuestSessionFixture {
44
+ error: {
45
+ code: number;
46
+ message: string;
47
+ };
48
+ }
49
+ /**
50
+ * Minimal domain-country payload used by authenticated host-shell fixtures.
51
+ */
52
+ export interface HostDomainCountryFixture {
53
+ currency: string;
54
+ currencyDecimalDigits: number;
55
+ decimalSymbol: string;
56
+ thousandsSymbol: string;
57
+ }
58
+ /**
59
+ * Authenticated user payload returned by the host auth probe.
60
+ */
61
+ export interface HostAuthenticatedSessionUserFixture {
62
+ email: string;
63
+ id: number;
64
+ firstName: string;
65
+ lastName: string;
66
+ accountId: number;
67
+ domainCountry: HostDomainCountryFixture;
68
+ avatarUrl?: string;
69
+ sessionId?: string;
70
+ dbType?: 'dt_main' | 'dt_admin' | 'dt_operative';
71
+ }
72
+ /**
73
+ * Response body used by the authenticated session bootstrap route.
74
+ */
75
+ export interface HostAuthenticatedSessionFixture {
76
+ user: HostAuthenticatedSessionUserFixture;
77
+ }
78
+ /**
79
+ * Raw authenticated user-preferences payload returned by
80
+ * `GET /users/me/preferences`.
81
+ *
82
+ * Keep this in backend shape because the shared route installer fulfills the
83
+ * network response before runtime camel-case normalization runs.
84
+ */
85
+ export interface HostUserPreferencesFixture {
86
+ locale?: {
87
+ id: string;
88
+ name?: string;
89
+ };
90
+ time_zone?: {
91
+ id: number;
92
+ name: string;
93
+ title?: string;
94
+ base_offset: number;
95
+ dst_offset: number;
96
+ country_code?: string;
97
+ };
98
+ date_format?: {
99
+ id?: number;
100
+ name?: string;
101
+ description?: string;
102
+ format: string;
103
+ };
104
+ time_format?: {
105
+ id?: number;
106
+ name?: string;
107
+ description?: string;
108
+ format: string;
109
+ };
110
+ decimal_symbol?: string;
111
+ thousands_symbol?: string;
112
+ currency?: string;
113
+ currency_decimal_digits?: number;
114
+ }
115
+ /**
116
+ * Minimal area summary returned by the host areas endpoint.
117
+ */
118
+ export interface HostAreaFixture {
119
+ id: string;
120
+ name: string;
121
+ }
122
+ /**
123
+ * Raw cookie record returned by the host cookies endpoint.
124
+ * Keep `container_id` in backend shape because the areas store reads it as-is.
125
+ */
126
+ export interface HostCookieFixture {
127
+ id: string;
128
+ container_id: string;
129
+ value: string;
130
+ }
131
+ /**
132
+ * Generic dynamic-parameter payload forwarded into the opened MF window.
133
+ */
134
+ export type HostDynamicParamsFixture = Record<string, unknown>;
135
+ /**
136
+ * Shared preview-scenario dynamic parameters commonly used by authenticated MFs.
137
+ */
138
+ export interface HostMfPreviewDynamicParamsFixture extends HostDynamicParamsFixture {
139
+ disableSelectionAutofocus?: boolean;
140
+ dummyPresetId?: string;
141
+ testCondition?: string;
142
+ }
143
+ /**
144
+ * Build-time input for the shared authenticated MF preview dynamic-params fixture.
145
+ */
146
+ export type CreateHostMfPreviewDynamicParamsFixtureOptions = HostMfPreviewDynamicParamsFixture;
147
+ /**
148
+ * Build-time input for the shared authenticated MF module-dictionary fixture.
149
+ */
150
+ export interface CreateHostAuthenticatedMfModuleDictionaryFixtureOptions {
151
+ moduleName: string;
152
+ moduleDescription?: string;
153
+ data?: Record<string, string>;
154
+ sections?: Record<string, Record<string, string>>;
155
+ }
156
+ /**
157
+ * Generic menu item payload returned by the host menus endpoint.
158
+ */
159
+ export interface HostMenuItemFixture extends Record<string, unknown> {
160
+ title: string;
161
+ iconUrl?: string;
162
+ moduleId?: string;
163
+ path?: string;
164
+ debugPort?: number;
165
+ dynamicParams?: HostDynamicParamsFixture;
166
+ children?: HostMenuItemFixture[];
167
+ }
168
+ /**
169
+ * Minimal MF identity contract consumed by authenticated host-preview helpers.
170
+ */
171
+ export interface HostAuthenticatedMfPreviewTargetOptions {
172
+ moduleId: string;
173
+ title: string;
174
+ debugPort: number;
175
+ iconUrl?: string;
176
+ dynamicParams?: HostDynamicParamsFixture;
177
+ }
178
+ /**
179
+ * Typed MF menu-entry input used by authenticated host-shell preview tests.
180
+ */
181
+ export interface CreateHostAuthenticatedMfMenuFixtureOptions extends HostAuthenticatedMfPreviewTargetOptions {
182
+ sectionTitle?: string;
183
+ }
184
+ /**
185
+ * Success payload used by host auth-style mutations.
186
+ */
187
+ export type HostMutationSuccessFixture = {
188
+ message: string;
189
+ [key: string]: unknown;
190
+ } | {
191
+ data: unknown;
192
+ [key: string]: unknown;
193
+ };
194
+ /**
195
+ * Error payload used by host auth-style mutations.
196
+ */
197
+ export interface HostMutationErrorFixture {
198
+ error: {
199
+ code: number;
200
+ message: string;
201
+ };
202
+ [key: string]: unknown;
203
+ }
204
+ export type HostMutationFixture = HostMutationSuccessFixture | HostMutationErrorFixture;
205
+ /**
206
+ * Installs the shared UI-config bootstrap route.
207
+ */
208
+ export interface InstallHostUIConfigRouteOptions {
209
+ page: Page;
210
+ uiConfig?: Partial<HostUIConfigFixture>;
211
+ status?: number;
212
+ delayMs?: number;
213
+ /** Resolve this promise when the route is allowed to fulfill. */
214
+ responseGate?: Promise<void>;
215
+ }
216
+ /**
217
+ * Shared override shape for guest/auth bootstrap helpers that need to control
218
+ * the first UI-config response without re-registering the route later.
219
+ */
220
+ export type HostUiConfigRouteControlOptions = Omit<InstallHostUIConfigRouteOptions, 'page' | 'uiConfig'>;
221
+ /**
222
+ * Installs the shared guest-session bootstrap route.
223
+ */
224
+ export interface InstallHostGuestSessionRouteOptions {
225
+ page: Page;
226
+ responseBody?: HostGuestSessionFixture;
227
+ status?: number;
228
+ }
229
+ /**
230
+ * Installs the shared authenticated session bootstrap route.
231
+ */
232
+ export interface InstallHostAuthenticatedSessionRouteOptions {
233
+ page: Page;
234
+ session?: Partial<HostAuthenticatedSessionUserFixture>;
235
+ status?: number;
236
+ delayMs?: number;
237
+ }
238
+ /**
239
+ * Installs the shared locale bootstrap route.
240
+ */
241
+ export interface InstallHostLocaleRouteOptions {
242
+ page: Page;
243
+ locale?: Partial<HostLocaleFixture>;
244
+ }
245
+ /**
246
+ * Installs the shared authenticated user-preferences bootstrap route.
247
+ */
248
+ export interface InstallHostUserPreferencesRouteOptions {
249
+ page: Page;
250
+ userPreferences?: Partial<HostUserPreferencesFixture>;
251
+ status?: number;
252
+ delayMs?: number;
253
+ }
254
+ /**
255
+ * Installs the shared no-auth dictionary bootstrap route.
256
+ */
257
+ export interface InstallHostModuleDictionaryRouteOptions {
258
+ page: Page;
259
+ moduleId: string;
260
+ moduleDictionary?: HostModuleDictionaryFixture;
261
+ isAuth?: boolean;
262
+ }
263
+ /**
264
+ * Installs the shared authenticated MF module-dictionary route used after the
265
+ * host opens a real MF preview bundle.
266
+ */
267
+ export interface InstallHostAuthenticatedMfModuleDictionaryRouteOptions extends CreateHostAuthenticatedMfModuleDictionaryFixtureOptions {
268
+ page: Page;
269
+ moduleId: string;
270
+ }
271
+ /**
272
+ * Installs the shared authenticated areas route.
273
+ */
274
+ export interface InstallHostAreasRouteOptions {
275
+ page: Page;
276
+ areas?: HostAreaFixture[];
277
+ }
278
+ /**
279
+ * Installs the shared cookies route used by the platform shell.
280
+ */
281
+ export interface InstallHostCookiesRouteOptions {
282
+ page: Page;
283
+ cookies?: HostCookieFixture[];
284
+ }
285
+ /**
286
+ * Installs the shared menus route used by the platform shell.
287
+ */
288
+ export interface InstallHostMenusRouteOptions {
289
+ page: Page;
290
+ menuData?: HostMenuItemFixture[];
291
+ /**
292
+ * Rows served to the **account popover** (`menus?position=1`), the door the host
293
+ * uses for user-scoped modules such as `shared_users_preferences_edit`.
294
+ *
295
+ * The host asks the same endpoint twice with a different `position`: `0` builds the
296
+ * sidebar tree, `1` builds the account popover under the user avatar. Omit this and
297
+ * both positions keep answering with `menuData`, which is what every suite written
298
+ * before the split expects.
299
+ */
300
+ accountMenuData?: HostMenuItemFixture[];
301
+ }
302
+ /**
303
+ * Installs the host alarms-count route consumed by the shell app bar badge.
304
+ */
305
+ export interface InstallHostAlarmsCountRouteOptions {
306
+ page: Page;
307
+ count?: number;
308
+ }
309
+ /**
310
+ * Installs a complete guest bootstrap baseline for host-style apps.
311
+ */
312
+ export interface InstallHostGuestBootstrapRoutesOptions {
313
+ page: Page;
314
+ moduleId: string;
315
+ uiConfig?: Partial<HostUIConfigFixture>;
316
+ uiConfigRouteOptions?: HostUiConfigRouteControlOptions;
317
+ locale?: Partial<HostLocaleFixture>;
318
+ moduleDictionary?: HostModuleDictionaryFixture;
319
+ }
320
+ /**
321
+ * Installs a complete authenticated bootstrap baseline for host-style apps.
322
+ */
323
+ export interface InstallHostAuthenticatedBootstrapRoutesOptions {
324
+ page: Page;
325
+ moduleId: string;
326
+ uiConfig?: Partial<HostUIConfigFixture>;
327
+ uiConfigRouteOptions?: HostUiConfigRouteControlOptions;
328
+ locale?: Partial<HostLocaleFixture>;
329
+ session?: Partial<HostAuthenticatedSessionUserFixture>;
330
+ userPreferences?: Partial<HostUserPreferencesFixture>;
331
+ moduleDictionary?: HostModuleDictionaryFixture;
332
+ areas?: HostAreaFixture[];
333
+ cookies?: HostCookieFixture[];
334
+ menuData?: HostMenuItemFixture[];
335
+ /** Rows served to the account popover. See `InstallHostMenusRouteOptions`. */
336
+ accountMenuData?: HostMenuItemFixture[];
337
+ }
338
+ /**
339
+ * Where the host publishes the target module's menu entry.
340
+ *
341
+ * `sidebar` is the default and covers every list module. `account` is for the modules
342
+ * a user only reaches from the avatar popover — the user-scoped preferences forms.
343
+ * Picking the wrong one fabricates a door the product does not have.
344
+ */
345
+ export type HostAuthenticatedMfMenuPosition = 'sidebar' | 'account';
346
+ /**
347
+ * Installs the authenticated host-shell baseline for one target MF preview flow.
348
+ */
349
+ export interface InstallHostAuthenticatedMfPreviewBootstrapOptions extends HostAuthenticatedMfPreviewTargetOptions {
350
+ page: Page;
351
+ uiConfig?: Partial<HostUIConfigFixture>;
352
+ locale?: Partial<HostLocaleFixture>;
353
+ session?: Partial<HostAuthenticatedSessionUserFixture>;
354
+ userPreferences?: Partial<HostUserPreferencesFixture>;
355
+ moduleDictionary?: HostModuleDictionaryFixture;
356
+ areas?: HostAreaFixture[];
357
+ cookies?: HostCookieFixture[];
358
+ hostModuleId?: string;
359
+ alarmCount?: number;
360
+ /**
361
+ * Which host menu carries the target module's entry. Defaults to `sidebar`.
362
+ *
363
+ * With `account` the entry is published to the avatar popover **and the sidebar is
364
+ * left empty**, so a suite cannot pass by clicking a sidebar row the product never
365
+ * renders for that module.
366
+ */
367
+ menuPosition?: HostAuthenticatedMfMenuPosition;
368
+ }
369
+ /**
370
+ * Opens a module from the host account popover (avatar → entry).
371
+ */
372
+ export interface OpenHostAccountMenuModuleOptions {
373
+ page: Page;
374
+ /** Visible label of the popover entry, as the account menu returns it. */
375
+ moduleTitle: string;
376
+ /** Accessible name of the avatar button that opens the popover. */
377
+ accountButtonName?: string;
378
+ }
379
+ /**
380
+ * Caller-owned route installer used for MF requests that happen after mount.
381
+ */
382
+ export type InstallHostAuthenticatedMfPreviewPostMountRoutes = (page: Page) => void | Promise<void>;
383
+ /**
384
+ * Shared options for host password mutation routes.
385
+ */
386
+ export interface InstallHostMutationRouteOptions {
387
+ page: Page;
388
+ responseBody?: HostMutationFixture;
389
+ status?: number;
390
+ delayMs?: number;
391
+ }
392
+ /**
393
+ * Installs the shared password-reset submit route.
394
+ */
395
+ export type InstallHostPasswordResetRouteOptions = InstallHostMutationRouteOptions;
396
+ /**
397
+ * Installs the shared new-password submit route.
398
+ */
399
+ export type InstallHostPasswordNewRouteOptions = InstallHostMutationRouteOptions;
400
+ /**
401
+ * Installs a deterministic browser-side MF render contract stub.
402
+ *
403
+ * Use this when an E2E suite needs to validate host-shell MF opening behavior
404
+ * without downloading a real remote bundle.
405
+ */
406
+ export interface InstallMicrofrontendRenderStubOptions {
407
+ page: Page;
408
+ moduleId: string;
409
+ prefix: string;
410
+ renderedText?: string;
411
+ renderedTestId?: string;
412
+ stateKey?: string;
413
+ }
414
+ /**
415
+ * Opens a host-shell sidebar module by title, expanding the sidebar when needed.
416
+ */
417
+ export interface OpenHostSidebarModuleOptions {
418
+ page: Page;
419
+ moduleTitle: string;
420
+ exact?: boolean;
421
+ toggleSelector?: string;
422
+ waitForModuleOpen?: OpenHostSidebarModuleWaitForModuleOpen;
423
+ maxClickAttempts?: number;
424
+ }
425
+ /**
426
+ * Timing snapshot for one host-shell sidebar open attempt.
427
+ */
428
+ export interface OpenHostSidebarModuleTimingSnapshot {
429
+ clickAttempts: number;
430
+ directClickMs: number;
431
+ toggleUsed: boolean;
432
+ totalMs: number;
433
+ }
434
+ /**
435
+ * Caller-owned readiness gate used after one sidebar click should open a module window.
436
+ */
437
+ export type OpenHostSidebarModuleWaitForModuleOpen = (page: Page, clickAttempt: number) => void | Promise<void>;
438
+ /**
439
+ * Installs the authenticated preview bootstrap, opens the host shell, launches
440
+ * the target sidebar entry, and leaves URL-state assertions to the owning app
441
+ * E2E suite.
442
+ */
443
+ export interface OpenHostAuthenticatedMfPreviewModuleOptions extends InstallHostAuthenticatedMfPreviewBootstrapOptions {
444
+ initialPath?: string;
445
+ exact?: boolean;
446
+ toggleSelector?: string;
447
+ installPostMountRoutes?: InstallHostAuthenticatedMfPreviewPostMountRoutes;
448
+ waitForModuleOpen?: OpenHostSidebarModuleWaitForModuleOpen;
449
+ maxSidebarClickAttempts?: number;
450
+ /**
451
+ * Skip debug-port readiness when the caller replaces the remote MF bundle
452
+ * with a browser-side render stub and no real preview origin needs to boot.
453
+ */
454
+ skipDebugPortReadyWait?: boolean;
455
+ }
456
+ /**
457
+ * Timing snapshot for the shared authenticated MF preview open flow.
458
+ */
459
+ export interface OpenHostAuthenticatedMfPreviewOpenTimingSnapshot {
460
+ gotoMs: number;
461
+ installBootstrapMs: number;
462
+ installPostMountRoutesMs: number;
463
+ sidebarClickAttempts: number;
464
+ sidebarOpenMs: number;
465
+ sidebarToggleUsed: boolean;
466
+ totalMs: number;
467
+ }
468
+ /**
469
+ * Standard pager metadata returned by GClick list endpoints.
470
+ */
471
+ export interface ListPagerFixture {
472
+ page: number;
473
+ total: number;
474
+ }
475
+ /**
476
+ * Standard `{ data, pager }` envelope returned by every GClick list endpoint.
477
+ */
478
+ export interface ListResponseFixture<TRow> {
479
+ data: TRow[];
480
+ pager: ListPagerFixture;
481
+ }
482
+ /**
483
+ * Build-time input for the shared list-endpoint response fixture.
484
+ */
485
+ export interface CreateListResponseFixtureOptions<TRow> {
486
+ /** Rows returned in the response `data` array. */
487
+ data: TRow[];
488
+ /** Pager page index reported back in the response (defaults to 0). */
489
+ pagerPage?: number;
490
+ /** Total record count reported by the pager (defaults to `data.length`). */
491
+ total?: number;
492
+ }
493
+ /**
494
+ * Installs a deterministic list-endpoint route for one list microfrontend, so any
495
+ * list E2E can render a known set of rows without hitting a real backend.
496
+ */
497
+ export interface InstallListEndpointRouteOptions<TRow> {
498
+ page: Page;
499
+ /** URL pattern that matches the list request, e.g. `/\/persons(?:\?.*)?$/`. */
500
+ endpointPattern: RegExp;
501
+ /** Rows returned in the response `data` array. */
502
+ data: TRow[];
503
+ /** Pager page index reported back in the response (defaults to 0). */
504
+ pagerPage?: number;
505
+ /** Total record count reported by the pager (defaults to `data.length`). */
506
+ total?: number;
507
+ /** HTTP status used for the fulfilled response (defaults to 200). */
508
+ status?: number;
509
+ }
510
+ /**
511
+ * Value type of a list filter, which drives how its value is entered in the
512
+ * DynamicFilter popover. Mirrors the component's `FieldType` 1:1, so a module's
513
+ * `field.type` maps directly to the scenario `type`; each module only declares
514
+ * the ones it has.
515
+ *
516
+ * Verification status of each branch:
517
+ * - `string`, `number`, `boolean`: live-verified (persons, all `multiple: true`).
518
+ * - `datetime`: has a real consumer (`operative_departments_list`); verify there.
519
+ * - `select`, `selectAsync` (RHFAutocompleteAsync): no consumer in the repo yet;
520
+ * built from the DynamicFilter source, verify when a module first uses them.
521
+ */
522
+ export type ListFilterValueType = 'string' | 'number' | 'boolean' | 'datetime' | 'select' | 'selectAsync';
523
+ /**
524
+ * Config-driven description of one filter to exercise in a list E2E. Each module
525
+ * declares one scenario per filter field so the same helper can apply every
526
+ * filter type without per-module interaction code.
527
+ */
528
+ export interface ListFilterScenario {
529
+ /** Visible menuitem label of the field (its dictionary label, e.g. "Name"). */
530
+ fieldLabel: string;
531
+ /** Drives how the value is entered (see {@link ListFilterValueType}). */
532
+ type: ListFilterValueType;
533
+ /** Value typed for `string`/`number`/`date`/`selectAsync` (search text). */
534
+ value?: string;
535
+ /** Upper bound for `datetime`, whose operand is a range. Defaults to `value`. */
536
+ valueTo?: string;
537
+ /** Option to pick by visible label for `select`/`selectAsync`/`boolean`. */
538
+ optionLabel?: string;
539
+ /**
540
+ * Field name as serialized into the `f` query param (e.g. `name`,
541
+ * `document_id` when the module snake-cases field names).
542
+ */
543
+ expectedFieldName: string;
544
+ }
545
+ /**
546
+ * Applies one list filter through the real DynamicFilter UI and captures the
547
+ * resulting list request.
548
+ */
549
+ export interface ApplyListFilterOptions {
550
+ page: Page;
551
+ /** The filter to apply. */
552
+ scenario: ListFilterScenario;
553
+ /** URL pattern of the list endpoint, used to capture the filtered request. */
554
+ endpointPattern: RegExp;
555
+ }
556
+ /**
557
+ * Applies several list filters in sequence and captures the final request (which
558
+ * carries all of them) — for the "multiple filters" contract.
559
+ */
560
+ export interface ApplyListFiltersOptions {
561
+ page: Page;
562
+ /** Filters to apply, in order. Must be non-empty. */
563
+ scenarios: ListFilterScenario[];
564
+ /** URL pattern of the list endpoint, used to capture the filtered request. */
565
+ endpointPattern: RegExp;
566
+ }
567
+ /**
568
+ * Config-driven description of one sort to exercise in a list E2E (sorting by a
569
+ * datagrid column header). One scenario per sort field of the module.
570
+ */
571
+ export interface ListSortScenario {
572
+ /** Column key in the header button aria-label `header-column-button-<columnKey>`. */
573
+ columnKey: string;
574
+ /** Field name as serialized into the `s` query param (snake-cased if applicable). */
575
+ expectedFieldName: string;
576
+ }
577
+ /**
578
+ * Applies one list sort through the real column-header menu and captures the
579
+ * resulting list request.
580
+ */
581
+ export interface ApplyListSortOptions {
582
+ page: Page;
583
+ /** The sort to apply. */
584
+ scenario: ListSortScenario;
585
+ /** URL pattern of the list endpoint, used to capture the sorted request. */
586
+ endpointPattern: RegExp;
587
+ }
588
+ /**
589
+ * Installs the module privileges route (`auth/login?privileges=...`) so the
590
+ * granted privilege keys exist and privilege-gated actions (e.g. Add) enable.
591
+ */
592
+ export interface InstallModulePrivilegesRouteOptions {
593
+ page: Page;
594
+ /** Privilege keys to grant; each becomes a present key the module checks. */
595
+ privileges: string[];
596
+ /** HTTP status used for the fulfilled response (defaults to 200). */
597
+ status?: number;
598
+ }
@@ -0,0 +1,4 @@
1
+ export * from './render';
2
+ export * from './resizeObserver';
3
+ export * from './matchMedia';
4
+ export * from './storage';
@@ -0,0 +1,10 @@
1
+ export interface InstallMatchMediaMockOptions {
2
+ matches?: boolean;
3
+ }
4
+ /**
5
+ * Installs a reusable `window.matchMedia` mock for browser-like package tests.
6
+ *
7
+ * Use this from package or app setup files when multiple tests rely on media
8
+ * query APIs and the runtime does not provide them natively.
9
+ */
10
+ export declare function installMatchMediaMock(options?: InstallMatchMediaMockOptions): void;
@@ -0,0 +1,17 @@
1
+ import { RenderResult } from '@testing-library/react';
2
+ import userEvent from '@testing-library/user-event';
3
+ import { ReactElement } from 'react';
4
+ /**
5
+ * Shared React Testing Library render entrypoint for packages and microfrontends.
6
+ *
7
+ * Use this when a test only needs the workspace-standard RTL lifecycle
8
+ * behavior: automatic cleanup, cleared Vitest mocks, and a ready `user`
9
+ * instance from `userEvent.setup()`.
10
+ *
11
+ * Do not extend this helper with feature-specific providers. Keep those
12
+ * wrappers local to the package or feature that owns them.
13
+ */
14
+ declare const customRender: (ui: ReactElement, options?: {}) => RenderResult & {
15
+ user: ReturnType<typeof userEvent.setup>;
16
+ };
17
+ export { customRender as render, };
@@ -0,0 +1,33 @@
1
+ import { vi } from 'vitest';
2
+ export interface CreateResizeObserverEntryOptions {
3
+ height?: number;
4
+ width?: number;
5
+ }
6
+ export interface InstallResizeObserverMockOptions {
7
+ autoTriggerOnObserve?: boolean;
8
+ createEntries?: (target: Element) => ResizeObserverEntry[];
9
+ }
10
+ export interface ResizeObserverMockController {
11
+ disconnect: ReturnType<typeof vi.fn>;
12
+ observe: ReturnType<typeof vi.fn>;
13
+ restore: () => void;
14
+ trigger: (entries?: ResizeObserverEntry[]) => void;
15
+ unobserve: ReturnType<typeof vi.fn>;
16
+ }
17
+ /**
18
+ * Builds a deterministic `ResizeObserverEntry` for width/height-driven tests.
19
+ *
20
+ * Use this when the behavior under test depends on measured element size and
21
+ * the test needs full control over the emitted observer payload.
22
+ */
23
+ export declare function createResizeObserverEntry(target: Element, options?: CreateResizeObserverEntryOptions): ResizeObserverEntry;
24
+ /**
25
+ * Installs a reusable `ResizeObserver` mock on `globalThis` and `window`.
26
+ *
27
+ * Use this for tests that need browser-like `ResizeObserver` behavior without
28
+ * introducing an ad-hoc inline class in each test file.
29
+ *
30
+ * Prefer a local mock only when the feature needs observer semantics that are
31
+ * too specific for the shared helper API.
32
+ */
33
+ export declare function installResizeObserverMock(options?: InstallResizeObserverMockOptions): ResizeObserverMockController;
@@ -0,0 +1,10 @@
1
+ export interface InstallStorageMockController {
2
+ clear: () => void;
3
+ localStorage: Storage;
4
+ restore: () => void;
5
+ sessionStorage: Storage;
6
+ }
7
+ /**
8
+ * Install stable `localStorage` and `sessionStorage` shims for tests that must not depend on runner-specific storage wiring.
9
+ */
10
+ export declare function installStorageMock(): InstallStorageMockController;
@@ -0,0 +1,6 @@
1
+ export { act } from 'react';
2
+ export { beforeEach, afterEach, beforeAll, afterAll, describe, expect, it, test, vi } from 'vitest';
3
+ export { cleanup, fireEvent, renderHook, screen, waitFor, within } from '@testing-library/react';
4
+ export { default as userEvent } from '@testing-library/user-event';
5
+ export { render } from '../rtl/src/render';
6
+ export * from '../vitest/src/index';