@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,24 @@
1
+ export declare const DEFAULT_RHF_SUBMIT_REF_GLOBAL_KEY = "__rhfOnSubmitRef";
2
+ export declare const M4L_APP_WINDOW_SIZES: {
3
+ square: {
4
+ large: {
5
+ width: number;
6
+ height: number;
7
+ };
8
+ medium: {
9
+ width: number;
10
+ height: number;
11
+ };
12
+ };
13
+ };
14
+ export declare const M4L_APP_DATAGRID_SEMANTIC_WIDTHS: {
15
+ date: number;
16
+ smallId: number;
17
+ smallName: number;
18
+ mediumId: number;
19
+ mediumName: number;
20
+ mediumNumber: number;
21
+ mediumChip: number;
22
+ mediumDescription: number;
23
+ smallDescription: number;
24
+ };
@@ -0,0 +1,5 @@
1
+ export * from './m4lAppBase';
2
+ export * from './m4lAppComponents';
3
+ export * from './m4lAppCore';
4
+ export * from './m4lAppGraphics';
5
+ export * from './m4lAppLayouts';
@@ -0,0 +1,9 @@
1
+ import type { CreateM4lAppBaseModuleMockOptions, VitestModuleMockExports } from '../../types';
2
+ /**
3
+ * Builds the shared `@m4l/base` mock payload used by M4L app test setups.
4
+ *
5
+ * Use this in host or MF `test/setup.ts` files when app tests import base
6
+ * primitives directly and should share the same neutral placeholder contract
7
+ * as package tests.
8
+ */
9
+ export declare function createM4lAppBaseModuleMock({ baseModule, moduleOverrides, }?: CreateM4lAppBaseModuleMockOptions): VitestModuleMockExports;
@@ -0,0 +1,20 @@
1
+ import type { CreateM4lAppComponentsModuleMockOptions, CreateM4lAppFormComponentsModuleOverridesOptions, VitestModuleMockExports } from '../../types';
2
+ /**
3
+ * Builds the shared `@m4l/components` mock payload used by M4L app test
4
+ * setups.
5
+ *
6
+ * Use this in an app root `test/setup.ts` when many tests need the same stable
7
+ * components baseline. Host and MF apps can keep only app-local overrides or
8
+ * extra mocks in the local setup file. In repository terminology, Patronus is
9
+ * only the visual design-system layer applied to these components, not the
10
+ * functional runtime contract represented by this mock.
11
+ */
12
+ export declare function createM4lAppComponentsModuleMock({ baseModule, moduleOverrides, submitRefGlobalKey, }?: CreateM4lAppComponentsModuleMockOptions): VitestModuleMockExports;
13
+ /**
14
+ * Builds reusable `@m4l/components` overrides for app-level form-oriented MFs.
15
+ *
16
+ * This helper keeps common setup-time mocks in `@m4l/testing/vitest` so app
17
+ * test setups can reuse the same baseline without copy/pasting local
18
+ * `moduleOverrides` payloads.
19
+ */
20
+ export declare function createM4lAppFormComponentsModuleOverrides({ dynamicMFParameters, }?: CreateM4lAppFormComponentsModuleOverridesOptions): VitestModuleMockExports;
@@ -0,0 +1,12 @@
1
+ import type { CreateM4lAppCoreModuleMockOptions, UnknownRecord, VitestModuleMockExports } from '../../types';
2
+ /**
3
+ * Builds the shared `@m4l/core` mock payload used by M4L app test setups.
4
+ *
5
+ * Use this when host or MF tests need deterministic environment data,
6
+ * dictionary labels, and host-tools behavior without mounting the real core
7
+ * runtime. Consumers can also spread `importOriginal` through `baseModule`
8
+ * when they need to preserve untouched exports. Patronus does not apply here
9
+ * as a runtime concept; in this repository it refers only to the visual
10
+ * design-system layer.
11
+ */
12
+ export declare function createM4lAppCoreModuleMock<TBaseStoreState = UnknownRecord>({ baseModule, baseStoreState, environmentData, hostToolsData, moduleLabel, getLabel, userPreferencesData, moduleOverrides, authState, flagsStoreState, }?: CreateM4lAppCoreModuleMockOptions<TBaseStoreState>): VitestModuleMockExports;
@@ -0,0 +1,10 @@
1
+ import type { CreateM4lAppGraphicsModuleMockOptions, VitestModuleMockExports } from '../../types';
2
+ /**
3
+ * Builds the shared `@m4l/graphics` mock payload used by M4L app test setups.
4
+ *
5
+ * Use this when the test only needs neutral pagination, rows, or responsive
6
+ * helpers while still supporting host-level graphics providers and stores. If
7
+ * a test needs to talk about Patronus, it should do so only for the visual
8
+ * theme/token layer, not for these runtime graphics hooks.
9
+ */
10
+ export declare function createM4lAppGraphicsModuleMock({ baseModule, moduleOverrides, }?: CreateM4lAppGraphicsModuleMockOptions): VitestModuleMockExports;
@@ -0,0 +1,18 @@
1
+ import type { CreateM4lAppFormLayoutsModuleOverridesOptions, CreateM4lAppLayoutsModuleMockOptions, VitestModuleMockExports } from '../../types';
2
+ /**
3
+ * Builds the shared `@m4l/layouts` mock payload used by M4L app test setups.
4
+ *
5
+ * Use this when the app test needs the layout shell contract to exist in the
6
+ * DOM without pulling in the real layouts package behavior. Patronus is not a
7
+ * layout-runtime concept here; it only names the visual design-system layer in
8
+ * the broader repository terminology.
9
+ */
10
+ export declare function createM4lAppLayoutsModuleMock({ baseModule, moduleOverrides, }?: CreateM4lAppLayoutsModuleMockOptions): VitestModuleMockExports;
11
+ /**
12
+ * Builds reusable `@m4l/layouts` overrides for app-level form-oriented MFs.
13
+ *
14
+ * This helper centralizes common setup-time form layout seams so app test
15
+ * setups can reuse the same baseline without redefining the same local
16
+ * `moduleOverrides` payload.
17
+ */
18
+ export declare function createM4lAppFormLayoutsModuleOverrides({ createComponentFieldImplementation, }?: CreateM4lAppFormLayoutsModuleOverridesOptions): VitestModuleMockExports;
@@ -0,0 +1 @@
1
+ export * from './m4lBaseComponents';
@@ -0,0 +1,13 @@
1
+ import type { CreateM4lBaseComponentsModuleMockOptions, VitestModuleMockExports } from '../../types';
2
+ /**
3
+ * Builds the shared library-safe `@m4l/components` mock surface used by
4
+ * package-level suites and reused by app-level factories.
5
+ *
6
+ * This intentionally covers reusable M4L component-system primitives, form
7
+ * helpers, formatters, and utility hooks that are safe for library tests.
8
+ * Within this repository, Patronus refers only to the visual design-system
9
+ * layer behind tokens, theme colors, and styling for those components; it does
10
+ * not name the functional runtime contract mocked here. App-shell and
11
+ * microfrontend-only collaborators stay in the app factory layer.
12
+ */
13
+ export declare function createM4lBaseComponentsModuleMock({ baseModule, moduleOverrides, submitRefGlobalKey, }?: CreateM4lBaseComponentsModuleMockOptions): VitestModuleMockExports;
@@ -0,0 +1,7 @@
1
+ export * from './app';
2
+ export * from './base';
3
+ export * from './leaflet';
4
+ export * from './packages';
5
+ export * from './reactHookForm';
6
+ export * from './reResizable';
7
+ export * from './reactLeaflet';
@@ -0,0 +1,10 @@
1
+ import type { CreateLeafletModuleMockOptions, VitestModuleMockExports } from '../types';
2
+ /**
3
+ * Builds a reusable partial `leaflet` module mock for tests that only need a
4
+ * stable `DomEvent` seam or `L.control.scale()` behavior.
5
+ *
6
+ * Keep plugin-specific state such as `geoJSON()`, `pm`, marker/icon factories,
7
+ * or highly feature-local Leaflet orchestration inside the owning test when
8
+ * that behavior is not yet shared across more than one slice.
9
+ */
10
+ export declare function createLeafletModuleMock({ baseModule, domEventData, moduleOverrides, scaleControlFactory, }?: CreateLeafletModuleMockOptions): VitestModuleMockExports;
@@ -0,0 +1,7 @@
1
+ export * from './m4lPackageBase';
2
+ export * from './m4lPackageComponents';
3
+ export * from './m4lPackageCore';
4
+ export * from './m4lPackageGclick';
5
+ export * from './m4lPackageGclickRealtime';
6
+ export * from './m4lPackageGraphics';
7
+ export * from './m4lPackageLayouts';
@@ -0,0 +1,11 @@
1
+ import type { CreateM4lPackageBaseModuleMockOptions, VitestModuleMockExports } from '../../types';
2
+ /**
3
+ * Builds the shared `@m4l/base` mock payload used by direct base-package
4
+ * consumers in package tests.
5
+ *
6
+ * Use this when a test imports `ButtonBase`, `Icon`, `Tooltip`, or `Typography`
7
+ * from `@m4l/base` directly and only needs neutral primitive placeholders.
8
+ * Keep `baseModule` populated from `importOriginal(...)` when the scenario
9
+ * still relies on the real constants or helper exports from the package.
10
+ */
11
+ export declare function createM4lPackageBaseModuleMock({ baseModule, moduleOverrides, }?: CreateM4lPackageBaseModuleMockOptions): VitestModuleMockExports;
@@ -0,0 +1,11 @@
1
+ import type { CreateM4lPackageComponentsModuleMockOptions, VitestModuleMockExports } from '../../types';
2
+ /**
3
+ * Builds the shared `@m4l/components` mock payload used by M4L package
4
+ * component tests.
5
+ *
6
+ * Use this when a package `test/setup.ts` needs lightweight hook and helper
7
+ * baselines without importing the broader app-shell component surface.
8
+ * `packages/gclick` is the current pilot consumer, but the helper itself is
9
+ * intentionally package-generic.
10
+ */
11
+ export declare function createM4lPackageComponentsModuleMock({ baseModule, dataGridPersistenceData, dynamicFilterAndSortData, modalData, moduleOverrides, popupsStoreData, windowToolsData, }?: CreateM4lPackageComponentsModuleMockOptions): VitestModuleMockExports;
@@ -0,0 +1,11 @@
1
+ import type { CreateM4lPackageCoreModuleMockOptions, VitestModuleMockExports } from '../../types';
2
+ /**
3
+ * Builds the shared `@m4l/core` mock payload used by M4L package component
4
+ * tests.
5
+ *
6
+ * Use this when a package `test/setup.ts` needs a deterministic baseline for
7
+ * environment, dictionary, host-tools, privileges, and network hooks without
8
+ * pulling in app-shell collaborators. `packages/gclick` is the current pilot
9
+ * consumer, but the helper itself is intentionally package-generic.
10
+ */
11
+ export declare function createM4lPackageCoreModuleMock({ baseModule, environmentData, getLabel, hostToolsData, moduleOverrides, moduleLabel, modulePrivilegesData, networkData, }?: CreateM4lPackageCoreModuleMockOptions): VitestModuleMockExports;
@@ -0,0 +1,10 @@
1
+ import type { CreateM4lPackageGclickModuleMockOptions, VitestModuleMockExports } from '../../types';
2
+ /**
3
+ * Builds the shared `@m4l/gclick` mock payload used by tests that depend on
4
+ * the exact runtime package.
5
+ *
6
+ * Use this when the test only needs stable map, indicator, and UI helper
7
+ * behavior from `@m4l/gclick` while keeping higher-level assertions focused
8
+ * on orchestration logic.
9
+ */
10
+ export declare function createM4lPackageGclickModuleMock({ baseModule, mapStoreState, moduleOverrides, }?: CreateM4lPackageGclickModuleMockOptions): VitestModuleMockExports;
@@ -0,0 +1,6 @@
1
+ import type { CreateM4lPackageGclickRealtimeModuleMockOptions, VitestModuleMockExports } from '../../types';
2
+ /**
3
+ * Build the shared `@m4l/gclick-realtime` mock surface for direct package and
4
+ * subpath consumers.
5
+ */
6
+ export declare function createM4lPackageGclickRealtimeModuleMock({ baseModule, moduleOverrides, surface, }?: CreateM4lPackageGclickRealtimeModuleMockOptions): VitestModuleMockExports;
@@ -0,0 +1,9 @@
1
+ import type { CreateM4lPackageGraphicsModuleMockOptions, VitestModuleMockExports } from '../../types';
2
+ /**
3
+ * Builds the shared `@m4l/graphics` mock payload used by M4L package
4
+ * component tests.
5
+ *
6
+ * Use this when a package test needs neutral rows, pagination, or color helper
7
+ * contracts without adopting the broader app-level graphics surface.
8
+ */
9
+ export declare function createM4lPackageGraphicsModuleMock({ baseModule, moduleOverrides, }?: CreateM4lPackageGraphicsModuleMockOptions): VitestModuleMockExports;
@@ -0,0 +1,10 @@
1
+ import type { CreateM4lPackageLayoutsModuleMockOptions, VitestModuleMockExports } from '../../types';
2
+ /**
3
+ * Builds the shared `@m4l/layouts` mock payload used by M4L package
4
+ * component tests.
5
+ *
6
+ * Use this when a package test needs neutral layout-shell components or hooks
7
+ * such as `DynamicTabs`, `useModule()`, or `useFormAddEdit()` without pulling
8
+ * the broader app-shell runtime surface into a library test.
9
+ */
10
+ export declare function createM4lPackageLayoutsModuleMock({ baseModule, moduleOverrides, }?: CreateM4lPackageLayoutsModuleMockOptions): VitestModuleMockExports;
@@ -0,0 +1,6 @@
1
+ import type { VitestModuleMockExports } from '../types';
2
+ /**
3
+ * Builds a minimal `re-resizable` module mock for tests that only need the
4
+ * resizable container to preserve its children in the DOM.
5
+ */
6
+ export declare function createReResizableModuleMock(): VitestModuleMockExports;
@@ -0,0 +1,10 @@
1
+ import type { CreateReactHookFormModuleMockOptions, VitestModuleMockExports } from '../types';
2
+ /**
3
+ * Builds a reusable `react-hook-form` module mock for tests that need
4
+ * `useFormContext()` compatibility without mounting a real RHF tree.
5
+ *
6
+ * Use `useFormContextData` when a suite needs to override shared members such
7
+ * as `setValue`, `reset`, or `formState` while keeping the rest of the module
8
+ * contract neutral and reusable.
9
+ */
10
+ export declare function createReactHookFormModuleMock({ baseModule, moduleOverrides, useFormContextData, }?: CreateReactHookFormModuleMockOptions): VitestModuleMockExports;
@@ -0,0 +1,10 @@
1
+ import type { CreateReactLeafletModuleMockOptions, VitestModuleMockExports } from '../types';
2
+ /**
3
+ * Builds a reusable `react-leaflet` module mock for tests that need neutral
4
+ * placeholder output for common shapes plus an overridable `useMap()` result.
5
+ *
6
+ * Keep feature-specific map interaction behavior such as Geoman orchestration,
7
+ * Leaflet `geoJSON()` behavior, or layer-specific event state local when the
8
+ * test depends on something more precise than these neutral placeholders.
9
+ */
10
+ export declare function createReactLeafletModuleMock({ baseModule, moduleOverrides, useMapData, useMapImplementation, }?: CreateReactLeafletModuleMockOptions): VitestModuleMockExports;
@@ -0,0 +1,71 @@
1
+ /**
2
+ * Default environment overrides used by the shared GClick app core module
3
+ * mock.
4
+ *
5
+ * Keep this baseline generic enough for host and MF test scaffolds, then
6
+ * override the few fields that belong to the specific app under test.
7
+ */
8
+ export declare const defaultM4lAppEnvironmentOverrides: {
9
+ database: string;
10
+ domain_token: string;
11
+ domainToken: string;
12
+ environment_assets: string;
13
+ host: string;
14
+ host_api_local: string;
15
+ hostApiLocal: string;
16
+ host_api_remote: string;
17
+ hostApiRemote: string;
18
+ hostRemote: string;
19
+ hostApiIcons: string;
20
+ host_static_assets: string;
21
+ isLocalhost: boolean;
22
+ };
23
+ /**
24
+ * Default environment overrides used by the shared M4L package test
25
+ * baseline.
26
+ *
27
+ * Keep this baseline focused on package-level hooks and icon/url generation,
28
+ * then let individual suites override only the fields that are scenario
29
+ * specific.
30
+ */
31
+ export declare const defaultM4lPackageEnvironmentOverrides: {
32
+ environment_assets: string;
33
+ host: string;
34
+ host_api_local: string;
35
+ hostApiLocal: string;
36
+ host_api_remote: string;
37
+ hostApiRemote: string;
38
+ hostApiIcons: string;
39
+ hostRemote: string;
40
+ host_static_assets: string;
41
+ database: string;
42
+ domain_token: string;
43
+ domainToken: string;
44
+ isLocalhost: boolean;
45
+ };
46
+ /**
47
+ * Stable relative-time formatter payload used by app component mocks that read
48
+ * `useDistanceToNowFormatter()`.
49
+ */
50
+ export declare const distanceToNowFormatterFixture: {
51
+ value: string;
52
+ unit: string;
53
+ };
54
+ /**
55
+ * Neutral GNSS signal enum fixture for app tests that need predictable signal
56
+ * values without importing the real runtime enum.
57
+ */
58
+ export declare const gclickGnssSignalEnumFixture: {
59
+ noSignal: number;
60
+ reliable: number;
61
+ acceptable: number;
62
+ };
63
+ /**
64
+ * Neutral GNSS motion-status enum fixture for app tests that need predictable
65
+ * motion values without importing the real runtime enum.
66
+ */
67
+ export declare const gclickGnssMotionStatusEnumFixture: {
68
+ off: number;
69
+ moving: number;
70
+ maxSpeed: number;
71
+ };
@@ -0,0 +1,184 @@
1
+ /**
2
+ * Minimal structural shape for a DataGrid column used by shared test helpers.
3
+ *
4
+ * This intentionally mirrors only the fields that the assertion helpers need to
5
+ * compare and avoids importing types from workspace component packages.
6
+ */
7
+ export interface TestingColumnShape {
8
+ key: string;
9
+ name: string;
10
+ type: string;
11
+ align?: string;
12
+ width?: number;
13
+ minWidth?: number;
14
+ visible?: boolean;
15
+ fixed?: boolean;
16
+ formatter?: unknown;
17
+ customFilter?: unknown;
18
+ customSort?: unknown;
19
+ testProps?: Record<string, unknown>;
20
+ }
21
+ /**
22
+ * Local structural stand-in for a nested-value column formatter hook call.
23
+ */
24
+ export interface TestingNestedValueHookCall {
25
+ type: 'nested';
26
+ fieldValue: string;
27
+ Component?: unknown;
28
+ defaultValue?: string;
29
+ }
30
+ /**
31
+ * Local structural stand-in for a date column formatter hook call.
32
+ */
33
+ export interface TestingDateHookCall {
34
+ type: 'date';
35
+ fieldValue: string;
36
+ presentationType: string;
37
+ }
38
+ /**
39
+ * Local structural stand-in for a boolean column formatter hook call.
40
+ */
41
+ export interface TestingBooleanHookCall {
42
+ type: 'boolean';
43
+ fieldValue: string;
44
+ presentationType: string;
45
+ }
46
+ /**
47
+ * Local structural stand-in for a price column formatter hook call.
48
+ */
49
+ export interface TestingPriceHookCall {
50
+ type: 'price';
51
+ fieldValue: string;
52
+ }
53
+ /**
54
+ * Local structural stand-in for a points column formatter hook call.
55
+ */
56
+ export interface TestingPointsHookCall {
57
+ type: 'points';
58
+ fieldValue: string;
59
+ fieldUnit: string;
60
+ }
61
+ /**
62
+ * Local structural stand-in for a number column formatter hook call.
63
+ */
64
+ export interface TestingNumberHookCall {
65
+ type: 'number';
66
+ fieldValue: string;
67
+ fractionDigits?: number;
68
+ }
69
+ /**
70
+ * Local structural stand-in for an interactive-check column formatter hook call.
71
+ */
72
+ export interface TestingInteractiveCheckHookCall {
73
+ type: 'interactiveCheck';
74
+ }
75
+ /**
76
+ * Local structural stand-in for a set-check column formatter hook call.
77
+ */
78
+ export interface TestingSetCheckHookCall {
79
+ type: 'setCheck';
80
+ field: string;
81
+ disabledGetter?: (...args: unknown[]) => unknown;
82
+ rowKeyGetter: (...args: unknown[]) => unknown;
83
+ useHook: (...args: unknown[]) => unknown;
84
+ }
85
+ /**
86
+ * Local structural stand-in for an uncertainty column formatter hook call.
87
+ */
88
+ export interface TestingUncertaintyHookCall {
89
+ type: 'uncertainty';
90
+ fieldValue: string;
91
+ fieldUnit: string;
92
+ fieldSymbol: string;
93
+ }
94
+ /**
95
+ * Local structural stand-in for a concatenated-values column formatter hook call.
96
+ */
97
+ export interface TestingConcatenatedHookCall {
98
+ type: 'concatenated';
99
+ fieldValue: string[];
100
+ fieldSeparator: string;
101
+ }
102
+ /**
103
+ * Local structural stand-in for a chip-status column formatter hook call.
104
+ */
105
+ export interface TestingChipStatusHookCall {
106
+ type: 'chipStatus';
107
+ fieldStatus: string;
108
+ fieldLabel: string | ((row: unknown, status: string) => string);
109
+ statusesColors?: Record<string, unknown>;
110
+ fallbackColor?: string;
111
+ }
112
+ /**
113
+ * Local structural stand-in for a tags column formatter hook call.
114
+ */
115
+ export interface TestingTagsHookCall {
116
+ type: 'tags';
117
+ fieldValue: string;
118
+ }
119
+ /**
120
+ * Local structural stand-in for an icon column formatter hook call.
121
+ */
122
+ export interface TestingIconHookCall {
123
+ type: 'icon';
124
+ getIconProps: (...args: unknown[]) => unknown;
125
+ }
126
+ /**
127
+ * Local structural stand-in for a color column formatter hook call.
128
+ */
129
+ export interface TestingColorHookCall {
130
+ type: 'color';
131
+ fieldValue: string;
132
+ size?: string | number;
133
+ className?: string;
134
+ }
135
+ /**
136
+ * Local structural stand-in for an image column formatter hook call.
137
+ */
138
+ export interface TestingImageHookCall {
139
+ type: 'image';
140
+ fieldValue: string;
141
+ fieldText?: string;
142
+ cover?: boolean;
143
+ width?: number;
144
+ height?: number;
145
+ }
146
+ /**
147
+ * Union of every supported structural hook-call shape used by the assertion
148
+ * helper.
149
+ */
150
+ export type TestingHookCall = TestingNestedValueHookCall | TestingDateHookCall | TestingBooleanHookCall | TestingPriceHookCall | TestingPointsHookCall | TestingNumberHookCall | TestingInteractiveCheckHookCall | TestingSetCheckHookCall | TestingUncertaintyHookCall | TestingConcatenatedHookCall | TestingChipStatusHookCall | TestingTagsHookCall | TestingIconHookCall | TestingColorHookCall | TestingImageHookCall;
151
+ /**
152
+ * Structural expected column config used by `assertColumnConfigs(...)`.
153
+ */
154
+ export interface TestingColumnConfig<T = unknown> extends Omit<TestingColumnShape, 'formatter' | 'customFilter' | 'customSort' | 'testProps'> {
155
+ hookCall?: TestingHookCall;
156
+ /**
157
+ * Reserved generic marker so consumers can keep their existing
158
+ * `TestingColumnConfig<Row>` usage without pulling real package types into
159
+ * this helper library.
160
+ */
161
+ __rowType?: T;
162
+ }
163
+ /**
164
+ * Structural actual column used by `assertColumnConfigs(...)`.
165
+ */
166
+ export type TestingColumn = TestingColumnShape;
167
+ /**
168
+ * Asserts that each column in `columns` matches the expected shape in `configs`.
169
+ *
170
+ * Returns an array of human-readable violation strings. An empty array means
171
+ * the columns fully satisfy the config contract. Pass the result to
172
+ * `expect(violations).toEqual([])` in the test body.
173
+ *
174
+ * Use this when a hook or helper builds a DataGrid column array and the test
175
+ * needs to verify basic properties (`key`, `name`, `type`, `align`, `width`,
176
+ * `visible`, `fixed`) plus the structural `testProps` passed through hook-based
177
+ * column builders. Keep the `describe` / `it` structure in the test file and
178
+ * call this helper inside a single `it` block.
179
+ *
180
+ * @param columns - The actual column array produced by the component or hook.
181
+ * @param configs - The expected column config specs, one entry per column.
182
+ * @returns Array of violation strings; empty when all columns satisfy the contract.
183
+ */
184
+ export declare function assertColumnConfigs<T>(columns: Array<TestingColumn>, configs: readonly TestingColumnConfig<T>[]): string[];