@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.
- package/README.md +679 -0
- package/chunks/reactLeaflet-Cffkauof.js +1846 -0
- package/chunks/render-CsuV8xqo.js +17 -0
- package/chunks/userPreferences-BmOgRaIX.js +493 -0
- package/index.js +76 -25
- package/mocks/index.js +41 -0
- package/package.json +84 -69
- package/playwright/index.js +2041 -0
- package/rtl/index.js +180 -0
- package/types/libs/observability/mf/src/browserRuntimeHandles.d.ts +112 -0
- package/types/libs/observability/mf/src/diagnosticLogging.d.ts +2 -0
- package/types/libs/observability/mf/src/diagnosticPolicies/catalog.d.ts +267 -0
- package/types/libs/observability/mf/src/diagnosticPolicies/contracts.d.ts +64 -0
- package/types/libs/observability/mf/src/diagnosticPolicies/host.d.ts +139 -0
- package/types/libs/observability/mf/src/diagnosticPolicies/index.d.ts +6 -0
- package/types/libs/observability/mf/src/diagnosticPolicies/operativeMyGpsDevices.d.ts +104 -0
- package/types/libs/observability/mf/src/diagnosticPolicies/sharedReportsList.d.ts +44 -0
- package/types/libs/observability/mf/src/diagnosticPolicyKeys.d.ts +34 -0
- package/types/libs/observability/mf/src/index.d.ts +14 -0
- package/types/libs/observability/mf/src/runtimeSmoke.d.ts +13 -0
- package/types/libs/observability/mf/src/telemetry.d.ts +2 -0
- package/types/libs/observability/shared/src/diagnosticLogging.d.ts +97 -0
- package/types/libs/observability/shared/src/index.d.ts +6 -0
- package/types/libs/observability/shared/src/runtimeHandles.d.ts +27 -0
- package/types/libs/observability/shared/src/telemetry.d.ts +179 -0
- package/types/packages/testing/mocks/src/constants.d.ts +10 -0
- package/types/packages/testing/mocks/src/fixtures.d.ts +258 -0
- package/types/packages/testing/mocks/src/helpers/environment.d.ts +44 -0
- package/types/packages/testing/mocks/src/helpers/hostTools.d.ts +10 -0
- package/types/packages/testing/mocks/src/helpers/index.d.ts +5 -0
- package/types/packages/testing/mocks/src/helpers/moduleDictionary.d.ts +9 -0
- package/types/packages/testing/mocks/src/helpers/toaster.d.ts +9 -0
- package/types/packages/testing/mocks/src/helpers/userPreferences.d.ts +17 -0
- package/types/packages/testing/mocks/src/index.d.ts +4 -0
- package/types/packages/testing/mocks/src/types.d.ts +233 -0
- package/types/packages/testing/playwright/src/fixtures/createHostAreaFixture.d.ts +5 -0
- package/types/packages/testing/playwright/src/fixtures/createHostAuthenticatedMfMenuFixture.d.ts +5 -0
- package/types/packages/testing/playwright/src/fixtures/createHostAuthenticatedMfModuleDictionaryFixture.d.ts +5 -0
- package/types/packages/testing/playwright/src/fixtures/createHostAuthenticatedSessionFixture.d.ts +6 -0
- package/types/packages/testing/playwright/src/fixtures/createHostCookieFixture.d.ts +5 -0
- package/types/packages/testing/playwright/src/fixtures/createHostGuestSessionFixture.d.ts +5 -0
- package/types/packages/testing/playwright/src/fixtures/createHostLocaleFixture.d.ts +5 -0
- package/types/packages/testing/playwright/src/fixtures/createHostMfPreviewDynamicParamsFixture.d.ts +5 -0
- package/types/packages/testing/playwright/src/fixtures/createHostModuleDictionaryFixture.d.ts +11 -0
- package/types/packages/testing/playwright/src/fixtures/createHostUiConfigFixture.d.ts +7 -0
- package/types/packages/testing/playwright/src/fixtures/createHostUserPreferencesFixture.d.ts +6 -0
- package/types/packages/testing/playwright/src/fixtures/createListResponseFixture.d.ts +6 -0
- package/types/packages/testing/playwright/src/fixtures/index.d.ts +12 -0
- package/types/packages/testing/playwright/src/helpers/attachJson.d.ts +9 -0
- package/types/packages/testing/playwright/src/helpers/formAccess.d.ts +53 -0
- package/types/packages/testing/playwright/src/helpers/formSelect.d.ts +51 -0
- package/types/packages/testing/playwright/src/helpers/formatFailedChecks.d.ts +18 -0
- package/types/packages/testing/playwright/src/helpers/index.d.ts +16 -0
- package/types/packages/testing/playwright/src/helpers/listDatagrid.d.ts +219 -0
- package/types/packages/testing/playwright/src/helpers/listDetail.d.ts +65 -0
- package/types/packages/testing/playwright/src/helpers/listFilter.d.ts +27 -0
- package/types/packages/testing/playwright/src/helpers/listSort.d.ts +19 -0
- package/types/packages/testing/playwright/src/helpers/listStatePersistence.d.ts +15 -0
- package/types/packages/testing/playwright/src/helpers/openHostAccountMenuModule.d.ts +10 -0
- package/types/packages/testing/playwright/src/helpers/openHostAuthenticatedMfPreviewModule.d.ts +5 -0
- package/types/packages/testing/playwright/src/helpers/openHostMobileSidebarModule.d.ts +15 -0
- package/types/packages/testing/playwright/src/helpers/openHostSidebarModule.d.ts +5 -0
- package/types/packages/testing/playwright/src/helpers/realtimePerformanceBrowser.d.ts +144 -0
- package/types/packages/testing/playwright/src/helpers/viewModeDataGrid.d.ts +67 -0
- package/types/packages/testing/playwright/src/helpers/waitForBrowserCondition.d.ts +38 -0
- package/types/packages/testing/playwright/src/index.d.ts +11 -0
- package/types/packages/testing/playwright/src/installers/index.d.ts +20 -0
- package/types/packages/testing/playwright/src/installers/installHostAlarmsCountRoute.d.ts +5 -0
- package/types/packages/testing/playwright/src/installers/installHostAreasRoute.d.ts +5 -0
- package/types/packages/testing/playwright/src/installers/installHostAuthenticatedBootstrapRoutes.d.ts +6 -0
- package/types/packages/testing/playwright/src/installers/installHostAuthenticatedMfModuleDictionaryRoute.d.ts +5 -0
- package/types/packages/testing/playwright/src/installers/installHostAuthenticatedMfPreviewBootstrap.d.ts +11 -0
- package/types/packages/testing/playwright/src/installers/installHostAuthenticatedSessionRoute.d.ts +6 -0
- package/types/packages/testing/playwright/src/installers/installHostCookiesRoute.d.ts +8 -0
- package/types/packages/testing/playwright/src/installers/installHostGuestBootstrapRoutes.d.ts +7 -0
- package/types/packages/testing/playwright/src/installers/installHostGuestSessionRoute.d.ts +7 -0
- package/types/packages/testing/playwright/src/installers/installHostLocaleRoute.d.ts +5 -0
- package/types/packages/testing/playwright/src/installers/installHostMenusRoute.d.ts +11 -0
- package/types/packages/testing/playwright/src/installers/installHostModuleDictionaryRoute.d.ts +6 -0
- package/types/packages/testing/playwright/src/installers/installHostPasswordNewRoute.d.ts +6 -0
- package/types/packages/testing/playwright/src/installers/installHostPasswordResetRoute.d.ts +6 -0
- package/types/packages/testing/playwright/src/installers/installHostUiConfigAssetRoutes.d.ts +9 -0
- package/types/packages/testing/playwright/src/installers/installHostUiConfigRoute.d.ts +7 -0
- package/types/packages/testing/playwright/src/installers/installHostUserPreferencesRoute.d.ts +6 -0
- package/types/packages/testing/playwright/src/installers/installListEndpointRoute.d.ts +7 -0
- package/types/packages/testing/playwright/src/installers/installMicrofrontendRenderStub.d.ts +9 -0
- package/types/packages/testing/playwright/src/installers/installModulePrivilegesRoute.d.ts +11 -0
- package/types/packages/testing/playwright/src/types.d.ts +598 -0
- package/types/packages/testing/rtl/src/index.d.ts +4 -0
- package/types/packages/testing/rtl/src/matchMedia.d.ts +10 -0
- package/types/packages/testing/rtl/src/render.d.ts +17 -0
- package/types/packages/testing/rtl/src/resizeObserver.d.ts +33 -0
- package/types/packages/testing/rtl/src/storage.d.ts +10 -0
- package/types/packages/testing/src/index.d.ts +6 -0
- package/types/packages/testing/vitest/src/constants.d.ts +24 -0
- package/types/packages/testing/vitest/src/factories/app/index.d.ts +5 -0
- package/types/packages/testing/vitest/src/factories/app/m4lAppBase.d.ts +9 -0
- package/types/packages/testing/vitest/src/factories/app/m4lAppComponents.d.ts +20 -0
- package/types/packages/testing/vitest/src/factories/app/m4lAppCore.d.ts +12 -0
- package/types/packages/testing/vitest/src/factories/app/m4lAppGraphics.d.ts +10 -0
- package/types/packages/testing/vitest/src/factories/app/m4lAppLayouts.d.ts +18 -0
- package/types/packages/testing/vitest/src/factories/base/index.d.ts +1 -0
- package/types/packages/testing/vitest/src/factories/base/m4lBaseComponents.d.ts +13 -0
- package/types/packages/testing/vitest/src/factories/index.d.ts +7 -0
- package/types/packages/testing/vitest/src/factories/leaflet.d.ts +10 -0
- package/types/packages/testing/vitest/src/factories/packages/index.d.ts +7 -0
- package/types/packages/testing/vitest/src/factories/packages/m4lPackageBase.d.ts +11 -0
- package/types/packages/testing/vitest/src/factories/packages/m4lPackageComponents.d.ts +11 -0
- package/types/packages/testing/vitest/src/factories/packages/m4lPackageCore.d.ts +11 -0
- package/types/packages/testing/vitest/src/factories/packages/m4lPackageGclick.d.ts +10 -0
- package/types/packages/testing/vitest/src/factories/packages/m4lPackageGclickRealtime.d.ts +6 -0
- package/types/packages/testing/vitest/src/factories/packages/m4lPackageGraphics.d.ts +9 -0
- package/types/packages/testing/vitest/src/factories/packages/m4lPackageLayouts.d.ts +10 -0
- package/types/packages/testing/vitest/src/factories/reResizable.d.ts +6 -0
- package/types/packages/testing/vitest/src/factories/reactHookForm.d.ts +10 -0
- package/types/packages/testing/vitest/src/factories/reactLeaflet.d.ts +10 -0
- package/types/packages/testing/vitest/src/fixtures.d.ts +71 -0
- package/types/packages/testing/vitest/src/helpers/columnConfigs.d.ts +184 -0
- package/types/packages/testing/vitest/src/helpers/elementMocks.d.ts +166 -0
- package/types/packages/testing/vitest/src/helpers/filterFields.d.ts +37 -0
- package/types/packages/testing/vitest/src/helpers/index.d.ts +9 -0
- package/types/packages/testing/vitest/src/helpers/mapStore.d.ts +9 -0
- package/types/packages/testing/vitest/src/helpers/moduleContract.d.ts +15 -0
- package/types/packages/testing/vitest/src/helpers/rhf.d.ts +8 -0
- package/types/packages/testing/vitest/src/helpers/serialization.d.ts +7 -0
- package/types/packages/testing/vitest/src/helpers/sortFields.d.ts +28 -0
- package/types/packages/testing/vitest/src/helpers/windowSizes.d.ts +1 -0
- package/types/packages/testing/vitest/src/index.d.ts +6 -0
- package/types/packages/testing/vitest/src/installers/consoleError.d.ts +9 -0
- package/types/packages/testing/vitest/src/installers/index.d.ts +2 -0
- package/types/packages/testing/vitest/src/installers/rhfSubmit.d.ts +9 -0
- package/types/packages/testing/vitest/src/types.d.ts +116 -0
- package/vitest/index.js +55 -0
- package/e2e/commands/components/Accordions/commands.d.ts +0 -4
- package/e2e/commands/components/Accordions/commands.js +0 -19
- package/e2e/commands/components/Accordions/types.d.ts +0 -63
- package/e2e/commands/components/CommonActions/commands.d.ts +0 -4
- package/e2e/commands/components/CommonActions/commands.js +0 -11
- package/e2e/commands/components/CommonActions/types.d.ts +0 -20
- package/e2e/commands/components/DataGrid/commands.d.ts +0 -4
- package/e2e/commands/components/DataGrid/commands.js +0 -42
- package/e2e/commands/components/DataGrid/types.d.ts +0 -140
- package/e2e/commands/components/DynamicFilter/commands.d.ts +0 -4
- package/e2e/commands/components/DynamicFilter/commands.js +0 -12
- package/e2e/commands/components/DynamicFilter/types.d.ts +0 -27
- package/e2e/commands/components/DynamicSort/commands.d.ts +0 -4
- package/e2e/commands/components/DynamicSort/commands.js +0 -10
- package/e2e/commands/components/DynamicSort/types.d.ts +0 -26
- package/e2e/commands/components/Filters/commands.d.ts +0 -4
- package/e2e/commands/components/Filters/commands.js +0 -24
- package/e2e/commands/components/Filters/types.d.ts +0 -91
- package/e2e/commands/components/Form/commands.d.ts +0 -4
- package/e2e/commands/components/Form/commands.js +0 -11
- package/e2e/commands/components/Form/cypress/assertInitialFormState/assertInitialFormState.d.ts +0 -5
- package/e2e/commands/components/Form/cypress/assertInitialFormState/assertInitialFormState.js +0 -20
- package/e2e/commands/components/Form/cypress/assertInitialFormState/type.d.ts +0 -105
- package/e2e/commands/components/Form/cypress/assertInitialFormState/type.js +0 -1
- package/e2e/commands/components/Form/cypress/assertMandatoryFields/assertMandatoryFields.d.ts +0 -17
- package/e2e/commands/components/Form/cypress/assertMandatoryFields/assertMandatoryFields.js +0 -14
- package/e2e/commands/components/Form/cypress/assertMandatoryFields/type.d.ts +0 -28
- package/e2e/commands/components/Form/cypress/assertMandatoryFields/type.js +0 -1
- package/e2e/commands/components/Form/cypress/constants.d.ts +0 -3
- package/e2e/commands/components/Form/cypress/constants.js +0 -6
- package/e2e/commands/components/Form/cypress/fillAndAssertFormFields/fillAndAssertFormFields.d.ts +0 -8
- package/e2e/commands/components/Form/cypress/fillAndAssertFormFields/fillAndAssertFormFields.js +0 -29
- package/e2e/commands/components/Form/cypress/fillAndAssertFormFields/type.d.ts +0 -5
- package/e2e/commands/components/Form/cypress/fillAndAssertFormFields/type.js +0 -1
- package/e2e/commands/components/Form/cypress/getFormScope/getFormScope.d.ts +0 -20
- package/e2e/commands/components/Form/cypress/getFormScope/getFormScope.js +0 -8
- package/e2e/commands/components/Form/cypress/proceedFormStep/proceedFormStep.d.ts +0 -10
- package/e2e/commands/components/Form/cypress/proceedFormStep/proceedFormStep.js +0 -6
- package/e2e/commands/components/Form/cypress/proceedFormStep/type.d.ts +0 -13
- package/e2e/commands/components/Form/helpers/getFieldNameDomElement.d.ts +0 -7
- package/e2e/commands/components/Form/helpers/getFieldNameDomElement.js +0 -13
- package/e2e/commands/components/Form/types.d.ts +0 -88
- package/e2e/commands/components/MenuActions/commands.d.ts +0 -4
- package/e2e/commands/components/MenuActions/commands.js +0 -8
- package/e2e/commands/components/MenuActions/types.d.ts +0 -24
- package/e2e/commands/components/Popover/commands.d.ts +0 -4
- package/e2e/commands/components/Popover/commands.js +0 -8
- package/e2e/commands/components/Popover/types.d.ts +0 -15
- package/e2e/commands/components/PropertyValue/commands.d.ts +0 -4
- package/e2e/commands/components/PropertyValue/commands.js +0 -8
- package/e2e/commands/components/PropertyValue/types.d.ts +0 -19
- package/e2e/commands/components/Tab/commands.d.ts +0 -4
- package/e2e/commands/components/Tab/commands.js +0 -9
- package/e2e/commands/components/Tab/types.d.ts +0 -29
- package/e2e/commands/components/WindowBase/commands.d.ts +0 -4
- package/e2e/commands/components/WindowBase/commands.js +0 -24
- package/e2e/commands/components/WindowBase/types.d.ts +0 -100
- package/e2e/commands/components/index.d.ts +0 -12
- package/e2e/commands/components/index.js +0 -1
- package/e2e/commands/index.d.ts +0 -7
- package/e2e/commands/index.js +0 -1
- package/e2e/commands/intercepts/index.d.ts +0 -2
- package/e2e/commands/intercepts/index.js +0 -1
- package/e2e/commands/intercepts/noPrivileges/interceptCommands.d.ts +0 -5
- package/e2e/commands/intercepts/noPrivileges/interceptCommands.js +0 -15
- package/e2e/commands/intercepts/noPrivileges/types.d.ts +0 -8
- package/e2e/commands/intercepts/noPrivileges/types.js +0 -1
- package/e2e/commands/register.d.ts +0 -4
- package/e2e/commands/register.js +0 -19
- package/e2e/cypress.d.js +0 -1
- package/e2e/cypress.d.ts +0 -24
- package/e2e/index.d.ts +0 -1
- package/e2e/types.d.ts +0 -4
- package/index.d.ts +0 -4
- package/index.test.d.ts +0 -1
- package/testComponents/DataGrid/helpers.d.ts +0 -5
- package/testComponents/DataGrid/helpers.js +0 -95
- package/testComponents/DataGrid/index.d.ts +0 -2
- package/testComponents/DataGrid/index.js +0 -1
- package/testComponents/DataGrid/types.d.ts +0 -54
- package/testComponents/DataGrid/types.js +0 -1
- package/testComponents/DynamicFilter/helpers.d.ts +0 -5
- package/testComponents/DynamicFilter/helpers.js +0 -18
- package/testComponents/DynamicFilter/index.d.ts +0 -1
- package/testComponents/DynamicFilter/index.js +0 -1
- package/testComponents/DynamicFilter/types.d.ts +0 -0
- package/testComponents/DynamicSort/helpers.d.ts +0 -5
- package/testComponents/DynamicSort/helpers.js +0 -16
- package/testComponents/DynamicSort/index.d.ts +0 -1
- package/testComponents/DynamicSort/index.js +0 -1
- package/testComponents/index.d.ts +0 -3
- package/testComponents/index.js +0 -1
- package/testTools/constants.d.ts +0 -0
- package/testTools/index.d.ts +0 -1
- package/testTools/index.js +0 -1
- package/testTools/mocks.d.ts +0 -0
- package/testTools/setup.d.ts +0 -0
- package/testTools/setup.js +0 -1
- package/testTools/types.d.ts +0 -0
- package/testTools/utils.d.ts +0 -11
- package/testTools/utils.js +0 -23
- package/vite-env.d.ts +0 -5
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { PropsWithChildren } from '../types';
|
|
3
|
+
type PaperFormProps = PropsWithChildren & {
|
|
4
|
+
title?: unknown;
|
|
5
|
+
};
|
|
6
|
+
type NamedFieldProps = {
|
|
7
|
+
name?: unknown;
|
|
8
|
+
};
|
|
9
|
+
type PropertyValueProps = {
|
|
10
|
+
property?: unknown;
|
|
11
|
+
};
|
|
12
|
+
type IconProps = {
|
|
13
|
+
src?: unknown;
|
|
14
|
+
};
|
|
15
|
+
type DividerProps = {
|
|
16
|
+
orientation?: unknown;
|
|
17
|
+
customVariant?: unknown;
|
|
18
|
+
};
|
|
19
|
+
type NavLinkProps = {
|
|
20
|
+
text?: React.ReactNode;
|
|
21
|
+
to?: unknown;
|
|
22
|
+
children?: React.ReactNode;
|
|
23
|
+
reloadDocument?: unknown;
|
|
24
|
+
[key: string]: unknown;
|
|
25
|
+
};
|
|
26
|
+
type ActionButtonMockOptions = {
|
|
27
|
+
testId: string;
|
|
28
|
+
disabledProp?: string;
|
|
29
|
+
handlerProp?: string;
|
|
30
|
+
labelProp?: string;
|
|
31
|
+
};
|
|
32
|
+
type WindowBaseProps = PropsWithChildren & {
|
|
33
|
+
title?: unknown;
|
|
34
|
+
onClose?: () => void;
|
|
35
|
+
};
|
|
36
|
+
type HelmetPageProps = PropsWithChildren & {
|
|
37
|
+
title?: unknown;
|
|
38
|
+
titlePrefix?: unknown;
|
|
39
|
+
subtitle?: unknown;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Creates a component mock that renders a `div` wrapper and preserves its
|
|
43
|
+
* children.
|
|
44
|
+
*
|
|
45
|
+
* Use this for layout-like component mocks where tests still need descendant
|
|
46
|
+
* rendering to stay visible in the DOM.
|
|
47
|
+
*/
|
|
48
|
+
export declare function createChildrenDivComponentMock(testId: string): import("vitest").Mock<({ children, ...props }: PropsWithChildren) => React.ReactElement<{
|
|
49
|
+
'data-testid': string;
|
|
50
|
+
}, string | React.JSXElementConstructor<any>>>;
|
|
51
|
+
/**
|
|
52
|
+
* Creates a component mock that renders a static `div` with optional text.
|
|
53
|
+
*
|
|
54
|
+
* Use this when the collaborator only needs to exist as a simple placeholder
|
|
55
|
+
* in the DOM and does not need to render child content.
|
|
56
|
+
*/
|
|
57
|
+
export declare function createStaticDivComponentMock(testId: string, text?: string): import("vitest").Mock<() => React.ReactElement<{
|
|
58
|
+
'data-testid': string;
|
|
59
|
+
}, string | React.JSXElementConstructor<any>>>;
|
|
60
|
+
/**
|
|
61
|
+
* Creates a `PaperForm` placeholder that keeps children mounted and captures
|
|
62
|
+
* the translated title as a stable test attribute.
|
|
63
|
+
*/
|
|
64
|
+
export declare function createPaperFormComponentMock(testId?: string): import("vitest").Mock<({ children, title }: PaperFormProps) => React.ReactElement<{
|
|
65
|
+
'data-testid': string;
|
|
66
|
+
'data-title': string;
|
|
67
|
+
}, string | React.JSXElementConstructor<any>>>;
|
|
68
|
+
/**
|
|
69
|
+
* Creates a container placeholder that preserves children without forwarding
|
|
70
|
+
* arbitrary layout props to the DOM.
|
|
71
|
+
*/
|
|
72
|
+
export declare function createChildrenContainerComponentMock(testId: string): import("vitest").Mock<({ children }: PropsWithChildren) => React.ReactElement<{
|
|
73
|
+
'data-testid': string;
|
|
74
|
+
}, string | React.JSXElementConstructor<any>>>;
|
|
75
|
+
/**
|
|
76
|
+
* Creates a `HelmetPage` placeholder that preserves children and exposes the
|
|
77
|
+
* received title metadata through stable DOM attributes.
|
|
78
|
+
*
|
|
79
|
+
* Use this in app-level test baselines when tests need to assert that page
|
|
80
|
+
* title props were forwarded correctly through `HelmetPage`.
|
|
81
|
+
*/
|
|
82
|
+
export declare function createHelmetPageComponentMock(testId?: string): import("vitest").Mock<({ children, subtitle, title, titlePrefix }: HelmetPageProps) => React.ReactElement<{
|
|
83
|
+
'data-testid': string;
|
|
84
|
+
'data-title': string;
|
|
85
|
+
'data-title-prefix': string;
|
|
86
|
+
'data-subtitle': string;
|
|
87
|
+
}, string | React.JSXElementConstructor<any>>>;
|
|
88
|
+
/**
|
|
89
|
+
* Creates a field placeholder that exposes the bound RHF name through the
|
|
90
|
+
* generated test id.
|
|
91
|
+
*/
|
|
92
|
+
export declare function createNamedFieldComponentMock(prefix: string): import("vitest").Mock<({ name }: NamedFieldProps) => React.ReactElement<{
|
|
93
|
+
'data-testid': string;
|
|
94
|
+
}, string | React.JSXElementConstructor<any>>>;
|
|
95
|
+
/**
|
|
96
|
+
* Creates a `PropertyValue` placeholder that exposes the property label
|
|
97
|
+
* through the generated test id.
|
|
98
|
+
*/
|
|
99
|
+
export declare function createPropertyValueComponentMock(prefix?: string): import("vitest").Mock<({ property }: PropertyValueProps) => React.ReactElement<{
|
|
100
|
+
'data-testid': string;
|
|
101
|
+
}, string | React.JSXElementConstructor<any>>>;
|
|
102
|
+
/**
|
|
103
|
+
* Creates a lightweight `Icon` placeholder that records the source URL on a
|
|
104
|
+
* stable DOM attribute.
|
|
105
|
+
*/
|
|
106
|
+
export declare function createIconComponentMock(attributeName?: string): import("vitest").Mock<({ src }: IconProps) => React.DetailedReactHTMLElement<{
|
|
107
|
+
[attributeName]: string;
|
|
108
|
+
}, HTMLElement>>;
|
|
109
|
+
/**
|
|
110
|
+
* Creates a lightweight divider placeholder that exposes common visual props
|
|
111
|
+
* through stable DOM attributes.
|
|
112
|
+
*/
|
|
113
|
+
export declare function createDividerComponentMock(testId?: string): import("vitest").Mock<({ customVariant, orientation }: DividerProps) => React.ReactElement<{
|
|
114
|
+
'data-testid': string;
|
|
115
|
+
'data-orientation': string;
|
|
116
|
+
'data-variant': string;
|
|
117
|
+
}, string | React.JSXElementConstructor<any>>>;
|
|
118
|
+
/**
|
|
119
|
+
* Creates a lightweight navigation-link placeholder that renders as a real
|
|
120
|
+
* anchor while keeping the API used by M4L component consumers.
|
|
121
|
+
*/
|
|
122
|
+
export declare function createNavLinkComponentMock(testId?: string): import("vitest").Mock<({ children, reloadDocument, text, to, ...props }: NavLinkProps) => React.ReactElement<{
|
|
123
|
+
'data-testid': string;
|
|
124
|
+
href: string;
|
|
125
|
+
'data-reload-document': string;
|
|
126
|
+
}, string | React.JSXElementConstructor<any>>>;
|
|
127
|
+
/**
|
|
128
|
+
* Creates a window-shell placeholder that preserves children, exposes the
|
|
129
|
+
* received title through a stable test attribute, and forwards the close
|
|
130
|
+
* callback through a standard button.
|
|
131
|
+
*/
|
|
132
|
+
export declare function createWindowBaseComponentMock(testId?: string): import("vitest").Mock<({ children, onClose, title }: WindowBaseProps) => React.ReactElement<{
|
|
133
|
+
'data-testid': string;
|
|
134
|
+
'data-title': string;
|
|
135
|
+
}, string | React.JSXElementConstructor<any>>>;
|
|
136
|
+
/**
|
|
137
|
+
* Creates a simple button-like mock that forwards label, disabled, and click
|
|
138
|
+
* handling through configurable prop keys.
|
|
139
|
+
*/
|
|
140
|
+
export declare function createActionButtonComponentMock({ testId, disabledProp, handlerProp, labelProp, }: ActionButtonMockOptions): import("vitest").Mock<(props: Record<string, unknown>) => React.DetailedReactHTMLElement<{
|
|
141
|
+
'data-testid': string;
|
|
142
|
+
disabled: boolean;
|
|
143
|
+
onClick: (() => void) | undefined;
|
|
144
|
+
}, HTMLElement>>;
|
|
145
|
+
/**
|
|
146
|
+
* Creates a `Loadable`-style mock implementation that renders the wrapped
|
|
147
|
+
* component inside `React.Suspense` and exposes stable test ids for both the
|
|
148
|
+
* wrapper and fallback.
|
|
149
|
+
*
|
|
150
|
+
* Use this when a test needs the app-level `@m4l/components` baseline from
|
|
151
|
+
* `test/setup.ts`, but the subject imports lazy routes or another
|
|
152
|
+
* suspense-aware component through `Loadable`. Prefer overriding the shared
|
|
153
|
+
* `Loadable` mock with this helper through `vi.mocked(Loadable)` instead of
|
|
154
|
+
* re-declaring the entire `@m4l/components` module mock in the test file.
|
|
155
|
+
*/
|
|
156
|
+
export declare function createSuspenseLoadableComponentMock(testId: string, fallbackTestId?: string): import("vitest").Mock<(Component: React.ElementType) => () => React.FunctionComponentElement<React.SuspenseProps>>;
|
|
157
|
+
/**
|
|
158
|
+
* Creates a neutral DataGrid-column hook mock that preserves the input props
|
|
159
|
+
* for later assertions.
|
|
160
|
+
*
|
|
161
|
+
* Use this in module-mock factories when the real grid column helpers are not
|
|
162
|
+
* under test but downstream code still expects formatter, filter, and sort
|
|
163
|
+
* members to exist.
|
|
164
|
+
*/
|
|
165
|
+
export declare function createDataGridColumnHookMock(): unknown;
|
|
166
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Minimal structural shape for a DynamicFilter field used by shared test
|
|
4
|
+
* helpers.
|
|
5
|
+
*/
|
|
6
|
+
export interface TestingFilterFieldShape {
|
|
7
|
+
name: string;
|
|
8
|
+
dictionaryId?: string;
|
|
9
|
+
type: string;
|
|
10
|
+
multiple?: boolean;
|
|
11
|
+
presence?: string;
|
|
12
|
+
urlIcon?: string | ReactElement;
|
|
13
|
+
icon?: ReactElement;
|
|
14
|
+
defaultOperator?: unknown;
|
|
15
|
+
restritcOperatorsTo?: unknown;
|
|
16
|
+
defaultOperand1?: unknown;
|
|
17
|
+
selectAsyncOptions?: Record<string, unknown>;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Asserts that each filter field in `actualFields` matches the shape in
|
|
21
|
+
* `expectedFields`.
|
|
22
|
+
*
|
|
23
|
+
* Returns an array of human-readable violation strings. An empty array means
|
|
24
|
+
* all fields satisfy the contract. Pass the result to
|
|
25
|
+
* `expect(violations).toEqual([])`.
|
|
26
|
+
*
|
|
27
|
+
* Checks per field: `name`, `dictionaryId`, `type`, `multiple`, `presence`,
|
|
28
|
+
* `defaultOperator` (when present), `restritcOperatorsTo` (when present),
|
|
29
|
+
* `defaultOperand1` (when present), `urlIcon` (when present). For
|
|
30
|
+
* `selectAsync` fields, also verifies that `selectAsyncOptions` is defined and
|
|
31
|
+
* structurally matches the expected object.
|
|
32
|
+
*
|
|
33
|
+
* @param actualFields - The actual filter field array from the component or hook.
|
|
34
|
+
* @param expectedFields - The expected filter field array to compare against.
|
|
35
|
+
* @returns Array of violation strings; empty when all fields satisfy the contract.
|
|
36
|
+
*/
|
|
37
|
+
export declare function assertFilterFields(actualFields: TestingFilterFieldShape[], expectedFields: TestingFilterFieldShape[]): string[];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './columnConfigs';
|
|
2
|
+
export * from './elementMocks';
|
|
3
|
+
export * from './filterFields';
|
|
4
|
+
export * from './rhf';
|
|
5
|
+
export * from './serialization';
|
|
6
|
+
export * from './sortFields';
|
|
7
|
+
export * from './mapStore';
|
|
8
|
+
export * from './moduleContract';
|
|
9
|
+
export * from './windowSizes';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { UnknownRecord } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Builds the minimal map-store state needed by the shared `@m4l/gclick` mock.
|
|
4
|
+
*
|
|
5
|
+
* Use this as the starting point when a test needs `useMapStore()` to expose
|
|
6
|
+
* standard map actions but the real `@m4l/gclick` map store behavior is not
|
|
7
|
+
* the focus.
|
|
8
|
+
*/
|
|
9
|
+
export declare function createDefaultM4lPackageGclickMapStoreState(): UnknownRecord;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type ModuleExportContractKind = 'callable' | 'value';
|
|
2
|
+
/**
|
|
3
|
+
* Classifies a module export using the coarse runtime contract needed by
|
|
4
|
+
* shared mock drift tests.
|
|
5
|
+
*/
|
|
6
|
+
export declare function getModuleExportContractKind(value: unknown): ModuleExportContractKind;
|
|
7
|
+
/**
|
|
8
|
+
* Returns mocked keys that no longer exist in the real module export surface.
|
|
9
|
+
*/
|
|
10
|
+
export declare function getMissingModuleMockExports(mockExports: Record<string, unknown>, realModule: Record<string, unknown>): string[];
|
|
11
|
+
/**
|
|
12
|
+
* Returns human-readable kind mismatches between a mock surface and the real
|
|
13
|
+
* module export surface.
|
|
14
|
+
*/
|
|
15
|
+
export declare function getModuleMockKindMismatches(mockExports: Record<string, unknown>, realModule: Record<string, unknown>): string[];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { RHFSubmitRef } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Reads the shared RHF submit ref installed by `installRhfOnSubmitRef(...)`.
|
|
4
|
+
*
|
|
5
|
+
* Use this inside module-mock factories or assertions that need to wire a mock
|
|
6
|
+
* submit callback through a stable global slot.
|
|
7
|
+
*/
|
|
8
|
+
export declare function getRHFSubmitRef(globalKey?: string): RHFSubmitRef | undefined;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Serializes viewer payloads into a deterministic string for simple DOM mocks.
|
|
3
|
+
*
|
|
4
|
+
* Use this when a component mock only needs to expose JSON-like content for
|
|
5
|
+
* assertions and the exact viewer implementation is outside the test scope.
|
|
6
|
+
*/
|
|
7
|
+
export declare function stringifyViewerData(data?: unknown): string;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Minimal structural shape for a DynamicSort field used by shared test helpers.
|
|
4
|
+
*/
|
|
5
|
+
export interface TestingSortFieldShape {
|
|
6
|
+
name: string;
|
|
7
|
+
dictionaryId?: string;
|
|
8
|
+
type: string;
|
|
9
|
+
presence?: string;
|
|
10
|
+
urlIcon?: string | ReactElement;
|
|
11
|
+
icon?: ReactElement;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Asserts that each sort field in `actualFields` matches the shape in
|
|
15
|
+
* `expectedFields`.
|
|
16
|
+
*
|
|
17
|
+
* Returns an array of human-readable violation strings. An empty array means
|
|
18
|
+
* all fields satisfy the contract. Pass the result to
|
|
19
|
+
* `expect(violations).toEqual([])`.
|
|
20
|
+
*
|
|
21
|
+
* Checks per field: `name`, `dictionaryId`, `type`, `presence`, and `urlIcon`
|
|
22
|
+
* (when present).
|
|
23
|
+
*
|
|
24
|
+
* @param actualFields - The actual sort field array from the component or hook.
|
|
25
|
+
* @param expectedFields - The expected sort field array to compare against.
|
|
26
|
+
* @returns Array of violation strings; empty when all fields satisfy the contract.
|
|
27
|
+
*/
|
|
28
|
+
export declare function assertSortFields(actualFields: TestingSortFieldShape[], expectedFields: TestingSortFieldShape[]): string[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { M4L_APP_DATAGRID_SEMANTIC_WIDTHS, M4L_APP_WINDOW_SIZES, } from '../constants';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { InstallConsoleErrorFilterOptions } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Installs a shared `console.error` filter for known noisy warnings.
|
|
4
|
+
*
|
|
5
|
+
* Use this in package or MF test setup when the suite has an intentional set
|
|
6
|
+
* of repeated warnings that would otherwise drown the useful failures. Keep
|
|
7
|
+
* the allowed patterns narrow and scenario-specific.
|
|
8
|
+
*/
|
|
9
|
+
export declare function installConsoleErrorFilter({ patterns, }: InstallConsoleErrorFilterOptions): void;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Installs a stable global submit ref used by shared RHF-based component
|
|
3
|
+
* mocks.
|
|
4
|
+
*
|
|
5
|
+
* Use this in MF `test/setup.ts` when the shared `RHFormProvider` mock should
|
|
6
|
+
* expose its submit callback through a predictable global ref for later test
|
|
7
|
+
* assertions.
|
|
8
|
+
*/
|
|
9
|
+
export declare function installRhfOnSubmitRef(globalKey?: string): void;
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import type { EnvironmentFixture, HostToolsFixture, UserPreferencesFixture } from '../../mocks/src/index';
|
|
2
|
+
import type React from 'react';
|
|
3
|
+
export type UnknownRecord = Record<string, unknown>;
|
|
4
|
+
export type VitestModuleMockExports = Record<string, unknown>;
|
|
5
|
+
export type PropsWithChildren = {
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
[key: string]: unknown;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Describes the button-like props used by the shared `Button` test placeholder.
|
|
11
|
+
*/
|
|
12
|
+
export interface ButtonMockProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
13
|
+
children?: React.ReactNode;
|
|
14
|
+
label?: React.ReactNode;
|
|
15
|
+
'data-testid'?: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Describes the button-like props used by the shared `IconButton` test placeholder.
|
|
19
|
+
*/
|
|
20
|
+
export interface IconButtonMockProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
21
|
+
children?: React.ReactNode;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Describes the button-like props used by the shared `Tab` test placeholder.
|
|
25
|
+
*/
|
|
26
|
+
export interface TabMockProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
27
|
+
children?: React.ReactNode;
|
|
28
|
+
label?: React.ReactNode;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Describes the reduced RHF provider contract used by the shared test placeholder.
|
|
32
|
+
*/
|
|
33
|
+
export interface RHFormProviderMockProps {
|
|
34
|
+
children?: React.ReactNode;
|
|
35
|
+
onSubmit?: () => void;
|
|
36
|
+
statusLoad?: string | null;
|
|
37
|
+
}
|
|
38
|
+
export type RHFSubmitRef = {
|
|
39
|
+
current: (() => void) | null;
|
|
40
|
+
};
|
|
41
|
+
export interface InstallConsoleErrorFilterOptions {
|
|
42
|
+
patterns: RegExp[];
|
|
43
|
+
}
|
|
44
|
+
export interface CreateVitestModuleMockOptions {
|
|
45
|
+
baseModule?: VitestModuleMockExports;
|
|
46
|
+
moduleOverrides?: VitestModuleMockExports;
|
|
47
|
+
}
|
|
48
|
+
export interface CreateM4lAppCoreModuleMockOptions<TBaseStoreState = UnknownRecord> extends CreateVitestModuleMockOptions {
|
|
49
|
+
baseStoreState?: TBaseStoreState;
|
|
50
|
+
environmentData?: Partial<EnvironmentFixture>;
|
|
51
|
+
hostToolsData?: HostToolsFixture;
|
|
52
|
+
moduleLabel?: string;
|
|
53
|
+
getLabel?: (key: string) => string;
|
|
54
|
+
userPreferencesData?: Partial<UserPreferencesFixture>;
|
|
55
|
+
authState?: {
|
|
56
|
+
isAuthenticated: boolean;
|
|
57
|
+
isInitialized: boolean;
|
|
58
|
+
user?: unknown;
|
|
59
|
+
login?: (...args: unknown[]) => object | undefined;
|
|
60
|
+
logout?: (...args: unknown[]) => Promise<void>;
|
|
61
|
+
};
|
|
62
|
+
flagsStoreState?: UnknownRecord;
|
|
63
|
+
}
|
|
64
|
+
export interface CreateM4lAppComponentsModuleMockOptions extends CreateVitestModuleMockOptions {
|
|
65
|
+
submitRefGlobalKey?: string;
|
|
66
|
+
}
|
|
67
|
+
export interface CreateM4lAppFormComponentsModuleOverridesOptions {
|
|
68
|
+
dynamicMFParameters?: UnknownRecord;
|
|
69
|
+
}
|
|
70
|
+
export interface CreateM4lAppFormLayoutsModuleOverridesOptions {
|
|
71
|
+
createComponentFieldImplementation?: (field: UnknownRecord) => unknown;
|
|
72
|
+
}
|
|
73
|
+
export interface CreateM4lBaseComponentsModuleMockOptions extends CreateVitestModuleMockOptions {
|
|
74
|
+
submitRefGlobalKey?: string;
|
|
75
|
+
}
|
|
76
|
+
export interface CreateM4lPackageCoreModuleMockOptions extends CreateVitestModuleMockOptions {
|
|
77
|
+
environmentData?: Partial<EnvironmentFixture>;
|
|
78
|
+
getLabel?: (key: string, value?: string) => string;
|
|
79
|
+
hostToolsData?: HostToolsFixture;
|
|
80
|
+
moduleLabel?: string;
|
|
81
|
+
modulePrivilegesData?: UnknownRecord;
|
|
82
|
+
networkData?: UnknownRecord;
|
|
83
|
+
}
|
|
84
|
+
export interface CreateM4lPackageComponentsModuleMockOptions extends CreateVitestModuleMockOptions {
|
|
85
|
+
dataGridPersistenceData?: UnknownRecord;
|
|
86
|
+
dynamicFilterAndSortData?: UnknownRecord;
|
|
87
|
+
modalData?: UnknownRecord;
|
|
88
|
+
popupsStoreData?: UnknownRecord;
|
|
89
|
+
windowToolsData?: UnknownRecord;
|
|
90
|
+
}
|
|
91
|
+
export type CreateM4lPackageBaseModuleMockOptions = CreateVitestModuleMockOptions;
|
|
92
|
+
export type CreateM4lAppBaseModuleMockOptions = CreateVitestModuleMockOptions;
|
|
93
|
+
export type CreateM4lPackageLayoutsModuleMockOptions = CreateVitestModuleMockOptions;
|
|
94
|
+
export type CreateM4lPackageGraphicsModuleMockOptions = CreateVitestModuleMockOptions;
|
|
95
|
+
export interface CreateM4lPackageGclickModuleMockOptions extends CreateVitestModuleMockOptions {
|
|
96
|
+
mapStoreState?: UnknownRecord;
|
|
97
|
+
}
|
|
98
|
+
export interface CreateM4lPackageGclickRealtimeModuleMockOptions extends CreateVitestModuleMockOptions {
|
|
99
|
+
surface?: 'root' | 'payload' | 'contracts';
|
|
100
|
+
}
|
|
101
|
+
export type CreateM4lAppGraphicsModuleMockOptions = CreateVitestModuleMockOptions;
|
|
102
|
+
export type CreateM4lAppLayoutsModuleMockOptions = CreateVitestModuleMockOptions;
|
|
103
|
+
export interface CreateReactLeafletModuleMockOptions extends CreateVitestModuleMockOptions {
|
|
104
|
+
useMapData?: unknown;
|
|
105
|
+
useMapImplementation?: () => unknown;
|
|
106
|
+
}
|
|
107
|
+
export interface CreateLeafletModuleMockOptions extends CreateVitestModuleMockOptions {
|
|
108
|
+
domEventData?: {
|
|
109
|
+
disableClickPropagation?: (target: HTMLElement) => void;
|
|
110
|
+
disableScrollPropagation?: (target: HTMLElement) => void;
|
|
111
|
+
};
|
|
112
|
+
scaleControlFactory?: () => unknown;
|
|
113
|
+
}
|
|
114
|
+
export interface CreateReactHookFormModuleMockOptions extends CreateVitestModuleMockOptions {
|
|
115
|
+
useFormContextData?: UnknownRecord;
|
|
116
|
+
}
|
package/vitest/index.js
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { D as o, a as t, M as c, f as s, v as r, y as M, s as l, k as n, h as i, u as k, z as p, p as d, l as u, o as m, P as C, G as g, H as F, J as A, I as P, N as S, K as E, L, O as R, Q as f, R as D, S as _, T as v, U as G, V as B, W as I, m as O, q as h, j as x, n as H, Y as T, X as y, Z as N, i as b, t as W, r as w, d as K, b as U, c as V, e as z, g as Y, B as Z, A as j, C as q, w as J, E as Q, F as X, x as $ } from "../chunks/reactLeaflet-Cffkauof.js";
|
|
2
|
+
export {
|
|
3
|
+
o as DEFAULT_RHF_SUBMIT_REF_GLOBAL_KEY,
|
|
4
|
+
t as M4L_APP_DATAGRID_SEMANTIC_WIDTHS,
|
|
5
|
+
c as M4L_APP_WINDOW_SIZES,
|
|
6
|
+
s as assertColumnConfigs,
|
|
7
|
+
r as assertFilterFields,
|
|
8
|
+
M as assertSortFields,
|
|
9
|
+
l as createActionButtonComponentMock,
|
|
10
|
+
n as createChildrenContainerComponentMock,
|
|
11
|
+
i as createChildrenDivComponentMock,
|
|
12
|
+
k as createDataGridColumnHookMock,
|
|
13
|
+
p as createDefaultM4lPackageGclickMapStoreState,
|
|
14
|
+
d as createDividerComponentMock,
|
|
15
|
+
u as createHelmetPageComponentMock,
|
|
16
|
+
m as createIconComponentMock,
|
|
17
|
+
C as createLeafletModuleMock,
|
|
18
|
+
g as createM4lAppBaseModuleMock,
|
|
19
|
+
F as createM4lAppComponentsModuleMock,
|
|
20
|
+
A as createM4lAppCoreModuleMock,
|
|
21
|
+
P as createM4lAppFormComponentsModuleOverrides,
|
|
22
|
+
S as createM4lAppFormLayoutsModuleOverrides,
|
|
23
|
+
E as createM4lAppGraphicsModuleMock,
|
|
24
|
+
L as createM4lAppLayoutsModuleMock,
|
|
25
|
+
R as createM4lBaseComponentsModuleMock,
|
|
26
|
+
f as createM4lPackageBaseModuleMock,
|
|
27
|
+
D as createM4lPackageComponentsModuleMock,
|
|
28
|
+
_ as createM4lPackageCoreModuleMock,
|
|
29
|
+
v as createM4lPackageGclickModuleMock,
|
|
30
|
+
G as createM4lPackageGclickRealtimeModuleMock,
|
|
31
|
+
B as createM4lPackageGraphicsModuleMock,
|
|
32
|
+
I as createM4lPackageLayoutsModuleMock,
|
|
33
|
+
O as createNamedFieldComponentMock,
|
|
34
|
+
h as createNavLinkComponentMock,
|
|
35
|
+
x as createPaperFormComponentMock,
|
|
36
|
+
H as createPropertyValueComponentMock,
|
|
37
|
+
T as createReResizableModuleMock,
|
|
38
|
+
y as createReactHookFormModuleMock,
|
|
39
|
+
N as createReactLeafletModuleMock,
|
|
40
|
+
b as createStaticDivComponentMock,
|
|
41
|
+
W as createSuspenseLoadableComponentMock,
|
|
42
|
+
w as createWindowBaseComponentMock,
|
|
43
|
+
K as defaultM4lAppEnvironmentOverrides,
|
|
44
|
+
U as defaultM4lPackageEnvironmentOverrides,
|
|
45
|
+
V as distanceToNowFormatterFixture,
|
|
46
|
+
z as gclickGnssMotionStatusEnumFixture,
|
|
47
|
+
Y as gclickGnssSignalEnumFixture,
|
|
48
|
+
Z as getMissingModuleMockExports,
|
|
49
|
+
j as getModuleExportContractKind,
|
|
50
|
+
q as getModuleMockKindMismatches,
|
|
51
|
+
J as getRHFSubmitRef,
|
|
52
|
+
Q as installConsoleErrorFilter,
|
|
53
|
+
X as installRhfOnSubmitRef,
|
|
54
|
+
$ as stringifyViewerData
|
|
55
|
+
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
const t = () => {
|
|
2
|
-
Cypress.Commands.add(
|
|
3
|
-
"m4lDynamicAccordionsValidate",
|
|
4
|
-
(e, o, r, a) => {
|
|
5
|
-
cy.get('[class*="M4LAccordion-accordionRoot"]').eq(r).as("currentAccordion"), cy.get("@currentAccordion").find('[class*="M4LAccordion-accordionSummary"]').should("have.text", a).click(), cy.get("@currentAccordion").within(() => {
|
|
6
|
-
cy.get('[class*="MuiCollapse-hidden"]').should("exist");
|
|
7
|
-
}), cy.get("@currentAccordion").find('[class*="M4LAccordion-accordionSummary"]').click(), cy.get("@currentAccordion").within(() => {
|
|
8
|
-
cy.get('[class*="MuiCollapse-entered"]').should("exist");
|
|
9
|
-
}), e(o).forEach((c) => {
|
|
10
|
-
cy.get("@currentAccordion").find('[class*="M4LAccordion-accordionDetails"]').find('[role="property-value-form-role"]').eq(c.index).within(() => {
|
|
11
|
-
cy.log(`Validating name ${c.key}`), cy.get('[class*="M4LPropertyValue-name"]').should("have.text", c.key), cy.log(`Validating value ${c.value}`), cy.get('[role="property-value-value-role"][class*="M4LPropertyValue-value"]').should("contain.text", c.value);
|
|
12
|
-
});
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
);
|
|
16
|
-
};
|
|
17
|
-
export {
|
|
18
|
-
t as r
|
|
19
|
-
};
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Property values accordion configuration
|
|
3
|
-
*/
|
|
4
|
-
export type M4lPropertyValuesAccordionsConfig = {
|
|
5
|
-
/**
|
|
6
|
-
* @param title - The accordion title
|
|
7
|
-
*/
|
|
8
|
-
title: string;
|
|
9
|
-
/**
|
|
10
|
-
* @param key - The property key
|
|
11
|
-
*/
|
|
12
|
-
key: string;
|
|
13
|
-
/**
|
|
14
|
-
* @param value - The property value
|
|
15
|
-
*/
|
|
16
|
-
value: any;
|
|
17
|
-
/**
|
|
18
|
-
* @param index - The property index
|
|
19
|
-
*/
|
|
20
|
-
index: number;
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
declare global {
|
|
24
|
-
namespace Cypress {
|
|
25
|
-
interface Chainable {
|
|
26
|
-
/**
|
|
27
|
-
* Validates the accordions using the dynamic accordions hook.
|
|
28
|
-
* Collapses/expands by title and checks each property key-value.
|
|
29
|
-
* @example
|
|
30
|
-
* const mockAccordions: M4lPropertyValuesAccordionsConfig[] = [
|
|
31
|
-
* { title: 'Details', key: 'Name', value: 'Item 1', index: 0 },
|
|
32
|
-
* { title: 'Details', key: 'Status', value: 'Active', index: 1 },
|
|
33
|
-
* ];
|
|
34
|
-
* cy.m4lDynamicAccordionsValidate(
|
|
35
|
-
* (acc) => acc,
|
|
36
|
-
* mockAccordions,
|
|
37
|
-
* 0,
|
|
38
|
-
* 'Details'
|
|
39
|
-
* );
|
|
40
|
-
*/
|
|
41
|
-
m4lDynamicAccordionsValidate(
|
|
42
|
-
/**
|
|
43
|
-
* @param accordions - Function that returns the accordion configurations
|
|
44
|
-
*/
|
|
45
|
-
accordions: (mockAccordions: M4lPropertyValuesAccordionsConfig[]) => M4lPropertyValuesAccordionsConfig[],
|
|
46
|
-
/**
|
|
47
|
-
* @param mockAccordions - The accordion configurations
|
|
48
|
-
*/
|
|
49
|
-
mockAccordions: M4lPropertyValuesAccordionsConfig[],
|
|
50
|
-
/**
|
|
51
|
-
* @param index - The accordion index
|
|
52
|
-
*/
|
|
53
|
-
index: number,
|
|
54
|
-
/**
|
|
55
|
-
* @param title - The accordion title
|
|
56
|
-
*/
|
|
57
|
-
title: string,
|
|
58
|
-
): Chainable<Element>;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export {};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
declare global {
|
|
2
|
-
namespace Cypress {
|
|
3
|
-
interface Chainable {
|
|
4
|
-
/**
|
|
5
|
-
* Finds the dialog action container, asserts it contains the option text, and clicks it.
|
|
6
|
-
* @example
|
|
7
|
-
* cy.m4lActionIntro('Accept');
|
|
8
|
-
* cy.m4lActionIntro('Cancel');
|
|
9
|
-
*/
|
|
10
|
-
m4lConfirmActionIntro(
|
|
11
|
-
/**
|
|
12
|
-
* Button option
|
|
13
|
-
*/
|
|
14
|
-
option: string,
|
|
15
|
-
): Chainable<Element>;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export {};
|