@siemens/ix 0.0.0-pr-1974-20250627115746 → 0.0.0-pr-1974-20250627142646
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/package.json +2 -2
- package/dist/collection/components/application-header/test/application-header.ct.js +0 -389
- package/dist/collection/components/application-header/test/application-header.ct.js.map +0 -1
- package/dist/collection/components/avatar/test/avatar.ct.js +0 -85
- package/dist/collection/components/avatar/test/avatar.ct.js.map +0 -1
- package/dist/collection/components/blind/test/blind.ct.js +0 -16
- package/dist/collection/components/blind/test/blind.ct.js.map +0 -1
- package/dist/collection/components/breadcrumb/test/breadcrumb.ct.js +0 -98
- package/dist/collection/components/breadcrumb/test/breadcrumb.ct.js.map +0 -1
- package/dist/collection/components/button/test/button.ct.js +0 -153
- package/dist/collection/components/button/test/button.ct.js.map +0 -1
- package/dist/collection/components/category-filter/test/category-filter.ct.js +0 -62
- package/dist/collection/components/category-filter/test/category-filter.ct.js.map +0 -1
- package/dist/collection/components/checkbox/tests/checkbox.ct.js +0 -86
- package/dist/collection/components/checkbox/tests/checkbox.ct.js.map +0 -1
- package/dist/collection/components/checkbox-group/test/checkbox-group.ct.js +0 -48
- package/dist/collection/components/checkbox-group/test/checkbox-group.ct.js.map +0 -1
- package/dist/collection/components/chip/test/chip.ct.js +0 -76
- package/dist/collection/components/chip/test/chip.ct.js.map +0 -1
- package/dist/collection/components/custom-field/tests/custom-field.ct.js +0 -68
- package/dist/collection/components/custom-field/tests/custom-field.ct.js.map +0 -1
- package/dist/collection/components/date-dropdown/test/date-dropdown.ct.js +0 -215
- package/dist/collection/components/date-dropdown/test/date-dropdown.ct.js.map +0 -1
- package/dist/collection/components/date-input/tests/date-input.ct.js +0 -117
- package/dist/collection/components/date-input/tests/date-input.ct.js.map +0 -1
- package/dist/collection/components/date-picker/test/date-picker.ct.js +0 -221
- package/dist/collection/components/date-picker/test/date-picker.ct.js.map +0 -1
- package/dist/collection/components/datetime-picker/test/datetime-picker.ct.js +0 -55
- package/dist/collection/components/datetime-picker/test/datetime-picker.ct.js.map +0 -1
- package/dist/collection/components/drawer/test/drawer.ct.js +0 -67
- package/dist/collection/components/drawer/test/drawer.ct.js.map +0 -1
- package/dist/collection/components/dropdown/test/dropdown.ct.js +0 -624
- package/dist/collection/components/dropdown/test/dropdown.ct.js.map +0 -1
- package/dist/collection/components/dropdown-button/dropdown-button.ct.js +0 -51
- package/dist/collection/components/dropdown-button/dropdown-button.ct.js.map +0 -1
- package/dist/collection/components/event-list/test/event-list.ct.js +0 -88
- package/dist/collection/components/event-list/test/event-list.ct.js.map +0 -1
- package/dist/collection/components/expanding-search/test/expanding-search.ct.js +0 -56
- package/dist/collection/components/expanding-search/test/expanding-search.ct.js.map +0 -1
- package/dist/collection/components/field-label/tests/field-label.ct.js +0 -121
- package/dist/collection/components/field-label/tests/field-label.ct.js.map +0 -1
- package/dist/collection/components/field-wrapper/tests/field-wrapper.ct.js +0 -63
- package/dist/collection/components/field-wrapper/tests/field-wrapper.ct.js.map +0 -1
- package/dist/collection/components/flip-tile/test/flip-tile.ct.js +0 -89
- package/dist/collection/components/flip-tile/test/flip-tile.ct.js.map +0 -1
- package/dist/collection/components/group/test/group.ct.js +0 -115
- package/dist/collection/components/group/test/group.ct.js.map +0 -1
- package/dist/collection/components/icon-button/test/icon-button.ct.js +0 -30
- package/dist/collection/components/icon-button/test/icon-button.ct.js.map +0 -1
- package/dist/collection/components/input/tests/form-ready.ct.js +0 -73
- package/dist/collection/components/input/tests/form-ready.ct.js.map +0 -1
- package/dist/collection/components/input/tests/validation.ct.js +0 -84
- package/dist/collection/components/input/tests/validation.ct.js.map +0 -1
- package/dist/collection/components/input-group/tests/input-group.ct.js +0 -161
- package/dist/collection/components/input-group/tests/input-group.ct.js.map +0 -1
- package/dist/collection/components/menu/test/menu.ct.js +0 -256
- package/dist/collection/components/menu/test/menu.ct.js.map +0 -1
- package/dist/collection/components/menu-about/test/menu-about.ct.js +0 -65
- package/dist/collection/components/menu-about/test/menu-about.ct.js.map +0 -1
- package/dist/collection/components/menu-avatar-item/test/menu-avatar-item.ct.js +0 -47
- package/dist/collection/components/menu-avatar-item/test/menu-avatar-item.ct.js.map +0 -1
- package/dist/collection/components/menu-category/test/menu-category.ct.js +0 -274
- package/dist/collection/components/menu-category/test/menu-category.ct.js.map +0 -1
- package/dist/collection/components/menu-item/test/menu-item.ct.js +0 -67
- package/dist/collection/components/menu-item/test/menu-item.ct.js.map +0 -1
- package/dist/collection/components/menu-settings/test/menu-settings.ct.js +0 -32
- package/dist/collection/components/menu-settings/test/menu-settings.ct.js.map +0 -1
- package/dist/collection/components/message-bar/test/message-bar.ct.js +0 -28
- package/dist/collection/components/message-bar/test/message-bar.ct.js.map +0 -1
- package/dist/collection/components/modal/test/modal.ct.js +0 -204
- package/dist/collection/components/modal/test/modal.ct.js.map +0 -1
- package/dist/collection/components/pagination/test/pagination.ct.js +0 -68
- package/dist/collection/components/pagination/test/pagination.ct.js.map +0 -1
- package/dist/collection/components/pane/test/panes.ct.js +0 -59
- package/dist/collection/components/pane/test/panes.ct.js.map +0 -1
- package/dist/collection/components/pane-layout/test/pane-layout.ct.js +0 -60
- package/dist/collection/components/pane-layout/test/pane-layout.ct.js.map +0 -1
- package/dist/collection/components/pill/test/pill.ct.js +0 -63
- package/dist/collection/components/pill/test/pill.ct.js.map +0 -1
- package/dist/collection/components/radio/test/radio.ct.js +0 -77
- package/dist/collection/components/radio/test/radio.ct.js.map +0 -1
- package/dist/collection/components/radio-group/test/radio-group.ct.js +0 -117
- package/dist/collection/components/radio-group/test/radio-group.ct.js.map +0 -1
- package/dist/collection/components/select/test/select-keyboard.ct.js +0 -380
- package/dist/collection/components/select/test/select-keyboard.ct.js.map +0 -1
- package/dist/collection/components/select/test/select.ct.js +0 -594
- package/dist/collection/components/select/test/select.ct.js.map +0 -1
- package/dist/collection/components/slider/test/slider.ct.js +0 -65
- package/dist/collection/components/slider/test/slider.ct.js.map +0 -1
- package/dist/collection/components/tabs/test/tabs.ct.js +0 -134
- package/dist/collection/components/tabs/test/tabs.ct.js.map +0 -1
- package/dist/collection/components/time-input/test/time-input.ct.js +0 -62
- package/dist/collection/components/time-input/test/time-input.ct.js.map +0 -1
- package/dist/collection/components/time-picker/test/time-picker.ct.js +0 -172
- package/dist/collection/components/time-picker/test/time-picker.ct.js.map +0 -1
- package/dist/collection/components/toggle/test/toggle.ct.js +0 -84
- package/dist/collection/components/toggle/test/toggle.ct.js.map +0 -1
- package/dist/collection/components/tooltip/test/tooltip.ct.js +0 -243
- package/dist/collection/components/tooltip/test/tooltip.ct.js.map +0 -1
- package/dist/collection/components/tree/test/tree.ct.js +0 -355
- package/dist/collection/components/tree/test/tree.ct.js.map +0 -1
- package/dist/collection/components/upload/test/upload.ct.js +0 -17
- package/dist/collection/components/upload/test/upload.ct.js.map +0 -1
- package/dist/collection/components/workflow-steps/test/workflow-steps.ct.js +0 -74
- package/dist/collection/components/workflow-steps/test/workflow-steps.ct.js.map +0 -1
- package/dist/collection/tests/utils/test/matchMedia.mock.js +0 -22
- package/dist/types/components/application-header/test/application-header.ct.d.ts +0 -1
- package/dist/types/components/avatar/test/avatar.ct.d.ts +0 -1
- package/dist/types/components/blind/test/blind.ct.d.ts +0 -1
- package/dist/types/components/breadcrumb/test/breadcrumb.ct.d.ts +0 -1
- package/dist/types/components/button/test/button.ct.d.ts +0 -7
- package/dist/types/components/category-filter/test/category-filter.ct.d.ts +0 -1
- package/dist/types/components/checkbox/tests/checkbox.ct.d.ts +0 -1
- package/dist/types/components/checkbox-group/test/checkbox-group.ct.d.ts +0 -1
- package/dist/types/components/chip/test/chip.ct.d.ts +0 -1
- package/dist/types/components/custom-field/tests/custom-field.ct.d.ts +0 -1
- package/dist/types/components/date-dropdown/test/date-dropdown.ct.d.ts +0 -1
- package/dist/types/components/date-input/tests/date-input.ct.d.ts +0 -1
- package/dist/types/components/date-picker/test/date-picker.ct.d.ts +0 -1
- package/dist/types/components/datetime-picker/test/datetime-picker.ct.d.ts +0 -1
- package/dist/types/components/drawer/test/drawer.ct.d.ts +0 -1
- package/dist/types/components/dropdown/test/dropdown.ct.d.ts +0 -1
- package/dist/types/components/dropdown-button/dropdown-button.ct.d.ts +0 -1
- package/dist/types/components/event-list/test/event-list.ct.d.ts +0 -1
- package/dist/types/components/expanding-search/test/expanding-search.ct.d.ts +0 -1
- package/dist/types/components/field-label/tests/field-label.ct.d.ts +0 -1
- package/dist/types/components/field-wrapper/tests/field-wrapper.ct.d.ts +0 -1
- package/dist/types/components/flip-tile/test/flip-tile.ct.d.ts +0 -1
- package/dist/types/components/group/test/group.ct.d.ts +0 -1
- package/dist/types/components/icon-button/test/icon-button.ct.d.ts +0 -1
- package/dist/types/components/input/tests/form-ready.ct.d.ts +0 -1
- package/dist/types/components/input/tests/validation.ct.d.ts +0 -1
- package/dist/types/components/input-group/tests/input-group.ct.d.ts +0 -1
- package/dist/types/components/menu/test/menu.ct.d.ts +0 -1
- package/dist/types/components/menu-about/test/menu-about.ct.d.ts +0 -1
- package/dist/types/components/menu-avatar-item/test/menu-avatar-item.ct.d.ts +0 -1
- package/dist/types/components/menu-category/test/menu-category.ct.d.ts +0 -1
- package/dist/types/components/menu-item/test/menu-item.ct.d.ts +0 -1
- package/dist/types/components/menu-settings/test/menu-settings.ct.d.ts +0 -1
- package/dist/types/components/message-bar/test/message-bar.ct.d.ts +0 -1
- package/dist/types/components/modal/test/modal.ct.d.ts +0 -8
- package/dist/types/components/pagination/test/pagination.ct.d.ts +0 -1
- package/dist/types/components/pane/test/panes.ct.d.ts +0 -1
- package/dist/types/components/pane-layout/test/pane-layout.ct.d.ts +0 -1
- package/dist/types/components/pill/test/pill.ct.d.ts +0 -1
- package/dist/types/components/radio/test/radio.ct.d.ts +0 -1
- package/dist/types/components/radio-group/test/radio-group.ct.d.ts +0 -1
- package/dist/types/components/select/test/select-keyboard.ct.d.ts +0 -1
- package/dist/types/components/select/test/select.ct.d.ts +0 -1
- package/dist/types/components/slider/test/slider.ct.d.ts +0 -1
- package/dist/types/components/tabs/test/tabs.ct.d.ts +0 -1
- package/dist/types/components/time-input/test/time-input.ct.d.ts +0 -1
- package/dist/types/components/time-picker/test/time-picker.ct.d.ts +0 -1
- package/dist/types/components/toggle/test/toggle.ct.d.ts +0 -1
- package/dist/types/components/tooltip/test/tooltip.ct.d.ts +0 -1
- package/dist/types/components/tree/test/tree.ct.d.ts +0 -1
- package/dist/types/components/upload/test/upload.ct.d.ts +0 -1
- package/dist/types/components/workflow-steps/test/workflow-steps.ct.d.ts +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chip.ct.js","sourceRoot":"","sources":["../../../../src/components/chip/test/chip.ct.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,cAAc,CAAC,SAAS,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE;IAClD,MAAM,KAAK,CAAC,qBAAqB,CAAC,CAAC;IACnC,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAC3C,MAAM,MAAM,CAAC,UAAU,CAAC,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;AACnD,CAAC,CAAC,CAAC;AAEH,cAAc,CAAC,QAAQ,CAAC,WAAW,EAAE,GAAG,EAAE;IACxC,cAAc,CAAC,UAAU,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE;QAC5C,MAAM,KAAK,CACT;;;OAGC,CACF,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,cAAc,CACZ,uDAAuD,EACvD,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;QACjB,MAAM,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;QAEtC,MAAM,iBAAiB,GAAG,IAAI,CAAC,OAAO,CAA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AC,UAAU,CAAC,cAAc,CAAC,CAAC;IACnD,CAAC,CACF,CAAC;IAEF,cAAc,CACZ,+EAA+E,EAC/E,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE;QACxB,MAAM,KAAK,CACT,oEAAoE,CACrE,CAAC;QACF,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QACrC,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC;QAEnB,MAAM,MAAM,CAAC,IAAI,CAAC,CAAC,eAAe,CAAC,cAAc,EAAE,qBAAqB,CAAC,CAAC;QAC1E,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;QAC3C,MAAM,MAAM,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;QAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC,qBAAqB,CAAC,CAAC;IAC1D,CAAC,CACF,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["/*\n * SPDX-FileCopyrightText: 2023 Siemens AG\n *\n * SPDX-License-Identifier: MIT\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { regressionTest } from '@utils/test';\nimport { expect } from '@playwright/test';\n\nregressionTest('renders', async ({ mount, page }) => {\n await mount(`<ix-chip></ix-chip>`);\n const datePicker = page.locator('ix-chip');\n await expect(datePicker).toHaveClass(/hydrated/);\n});\n\nregressionTest.describe('chip test', () => {\n regressionTest.beforeEach(async ({ mount }) => {\n await mount(\n `\n <ix-chip>Label</ix-chip>\n <ix-chip outline>Label</ix-chip>\n `\n );\n });\n\n regressionTest(\n 'outline and normal variant should have the same width',\n async ({ page }) => {\n await page.waitForSelector('ix-chip');\n\n const normalChipElement = page.locator('ix-chip').first();\n const outlineChipElement = page.locator('ix-chip').last();\n\n const normalChipSize = (await normalChipElement.boundingBox()) as {\n x: number;\n y: number;\n width: number;\n height: number;\n };\n const outlineChipSize = (await outlineChipElement.boundingBox()) as {\n x: number;\n y: number;\n width: number;\n height: number;\n };\n\n expect(normalChipSize).not.toBeNull();\n expect(outlineChipSize).not.toBeNull();\n expect(normalChipSize.width).toEqual(outlineChipSize.width);\n }\n );\n});\n\nregressionTest('check inactive class', async ({ mount, page }) => {\n await mount(`<ix-chip active=\"false\">test</ix-chip>`);\n const chip = page.locator('ix-chip');\n await expect(chip).toHaveClass('inactive hydrated');\n});\n\nregressionTest.describe('tooltip', () => {\n regressionTest(\n 'should not display when tooltip-text attribute is absent',\n async ({ mount, page }) => {\n await mount('<ix-chip>Text content</ix-chip>');\n const chip = page.locator('ix-chip');\n await chip.hover();\n\n await expect(chip).not.toHaveAttribute('tooltip-text');\n const tooltip = chip.locator('ix-tooltip');\n await expect(tooltip).not.toBeAttached();\n }\n );\n\n regressionTest(\n 'should display the component text content when tooltip-text attribute is an empty string',\n async ({ mount, page }) => {\n await mount('<ix-chip tooltip-text=\"\">Text content</ix-chip>');\n const chip = page.locator('ix-chip');\n await chip.hover();\n\n await expect(chip).toHaveAttribute('tooltip-text', '');\n const tooltip = chip.locator('ix-tooltip');\n await expect(tooltip).toHaveClass(/visible/);\n await expect(tooltip).toHaveText('Text content');\n }\n );\n\n regressionTest(\n 'should display the component text content when tooltip-text attribute is present but no value is set',\n async ({ mount, page }) => {\n await mount('<ix-chip tooltip-text>Text content</ix-chip>');\n const chip = page.locator('ix-chip');\n await chip.hover();\n\n await expect(chip).toHaveAttribute('tooltip-text', undefined);\n const tooltip = chip.locator('ix-tooltip');\n await expect(tooltip).toHaveClass(/visible/);\n await expect(tooltip).toHaveText('Text content');\n }\n );\n\n regressionTest(\n 'should display the custom text when tooltip-text attribute is a custom string',\n async ({ mount, page }) => {\n await mount(\n '<ix-chip tooltip-text=\"custom tooltip text\">Text content</ix-chip>'\n );\n const chip = page.locator('ix-chip');\n await chip.hover();\n\n await expect(chip).toHaveAttribute('tooltip-text', 'custom tooltip text');\n const tooltip = chip.locator('ix-tooltip');\n await expect(tooltip).toHaveClass(/visible/);\n await expect(tooltip).toHaveText('custom tooltip text');\n }\n );\n});\n"]}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* SPDX-FileCopyrightText: 2024 Siemens AG
|
|
3
|
-
*
|
|
4
|
-
* SPDX-License-Identifier: MIT
|
|
5
|
-
*
|
|
6
|
-
* This source code is licensed under the MIT license found in the
|
|
7
|
-
* LICENSE file in the root directory of this source tree.
|
|
8
|
-
*/
|
|
9
|
-
import { expect } from "@playwright/test";
|
|
10
|
-
import { regressionTest } from "../../../tests/utils/test/index";
|
|
11
|
-
regressionTest('renders', async ({ mount, page }) => {
|
|
12
|
-
await mount(`<ix-custom-field></ix-custom-field>`);
|
|
13
|
-
const customFieldElement = page.locator('ix-custom-field');
|
|
14
|
-
await expect(customFieldElement).toHaveClass(/hydrated/);
|
|
15
|
-
});
|
|
16
|
-
regressionTest('renders with label', async ({ mount, page }) => {
|
|
17
|
-
await mount(`<ix-custom-field label="Label"><input /></ix-custom-field>`);
|
|
18
|
-
const customFieldElement = page.locator('ix-custom-field');
|
|
19
|
-
const fieldLabel = customFieldElement.locator('ix-field-label');
|
|
20
|
-
const typography = fieldLabel.locator('label').locator('ix-typography');
|
|
21
|
-
await expect(customFieldElement).toHaveClass(/hydrated/);
|
|
22
|
-
await expect(fieldLabel).toHaveClass(/hydrated/);
|
|
23
|
-
await expect(typography).toHaveClass(/typography-label/);
|
|
24
|
-
await expect(fieldLabel.filter({ hasText: 'Label' })).toHaveText('Label');
|
|
25
|
-
});
|
|
26
|
-
regressionTest('renders with helper-text', async ({ mount, page }) => {
|
|
27
|
-
await mount(`<ix-custom-field helper-text="Some helper text" invalid-text="Error"></ix-custom-field>`);
|
|
28
|
-
const customFieldElement = page.locator('ix-custom-field');
|
|
29
|
-
const fieldWrapper = customFieldElement.locator('ix-field-wrapper');
|
|
30
|
-
await expect(customFieldElement).toHaveClass(/hydrated/);
|
|
31
|
-
await expect(fieldWrapper).toHaveClass(/hydrated/);
|
|
32
|
-
await expect(fieldWrapper.filter({ hasText: 'Some helper text' })).toHaveText('Some helper text');
|
|
33
|
-
});
|
|
34
|
-
regressionTest('renders with invalid-text', async ({ mount, page }) => {
|
|
35
|
-
await mount(`<ix-custom-field helper-text="Some helper text" invalid-text="Error">
|
|
36
|
-
<input class="ix-invalid" />
|
|
37
|
-
</ix-custom-field>`);
|
|
38
|
-
const customFieldElement = page.locator('ix-custom-field');
|
|
39
|
-
const fieldWrapper = customFieldElement.locator('ix-field-wrapper');
|
|
40
|
-
await expect(customFieldElement).toHaveClass(/hydrated/);
|
|
41
|
-
await expect(fieldWrapper).toHaveClass(/hydrated/);
|
|
42
|
-
await expect(fieldWrapper.filter({ hasText: 'Error' })).toHaveText('Error');
|
|
43
|
-
});
|
|
44
|
-
regressionTest('renders with invalid-text if on child is invalid', async ({ mount, page }) => {
|
|
45
|
-
await mount(`<ix-custom-field helper-text="Some helper text" invalid-text="Error">
|
|
46
|
-
<input />
|
|
47
|
-
<div data-testid="custom">Some custom</div>
|
|
48
|
-
</ix-custom-field>`);
|
|
49
|
-
const customFieldElement = page.locator('ix-custom-field');
|
|
50
|
-
const fieldWrapper = customFieldElement.locator('ix-field-wrapper');
|
|
51
|
-
await expect(customFieldElement).toHaveClass(/hydrated/);
|
|
52
|
-
await expect(fieldWrapper).toHaveClass(/hydrated/);
|
|
53
|
-
await expect(fieldWrapper.filter({ hasText: 'Some helper text' })).toHaveText('Some helper text');
|
|
54
|
-
const custom = customFieldElement.getByTestId('custom');
|
|
55
|
-
custom.evaluate((node) => node.classList.add('ix-invalid'));
|
|
56
|
-
await expect(fieldWrapper.filter({ hasText: 'Error' })).toHaveText('Error');
|
|
57
|
-
});
|
|
58
|
-
regressionTest('renders with required label', async ({ mount, page }) => {
|
|
59
|
-
await mount(`<ix-custom-field label="Label" required><input/></ix-custom-field>`);
|
|
60
|
-
const customFieldElement = page.locator('ix-custom-field');
|
|
61
|
-
const fieldLabel = customFieldElement.locator('ix-field-label');
|
|
62
|
-
const typography = fieldLabel.locator('label').locator('ix-typography');
|
|
63
|
-
await expect(customFieldElement).toHaveClass(/hydrated/);
|
|
64
|
-
await expect(fieldLabel).toHaveClass(/hydrated/);
|
|
65
|
-
await expect(typography).toHaveClass(/typography-label/);
|
|
66
|
-
await expect(fieldLabel.filter({ hasText: 'Label*' })).toHaveText('Label*');
|
|
67
|
-
});
|
|
68
|
-
//# sourceMappingURL=custom-field.ct.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"custom-field.ct.js","sourceRoot":"","sources":["../../../../src/components/custom-field/tests/custom-field.ct.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,cAAc,CAAC,SAAS,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE;IAClD,MAAM,KAAK,CAAC,qCAAqC,CAAC,CAAC;IACnD,MAAM,kBAAkB,GAAG,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAC3D,MAAM,MAAM,CAAC,kBAAkB,CAAC,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;AAC3D,CAAC,CAAC,CAAC;AAEH,cAAc,CAAC,oBAAoB,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE;IAC7D,MAAM,KAAK,CAAC,4DAA4D,CAAC,CAAC;IAC1E,MAAM,kBAAkB,GAAG,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAC3D,MAAM,UAAU,GAAG,kBAAkB,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAChE,MAAM,UAAU,GAAG,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,eAAe,CAAC,C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,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE;IACtE,MAAM,KAAK,CACT,oEAAoE,CACrE,CAAC;IACF,MAAM,kBAAkB,GAAG,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAC3D,MAAM,UAAU,GAAG,kBAAkB,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAChE,MAAM,UAAU,GAAG,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;IACxE,MAAM,MAAM,CAAC,kBAAkB,CAAC,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IACzD,MAAM,MAAM,CAAC,UAAU,CAAC,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IACjD,MAAM,MAAM,CAAC,UAAU,CAAC,CAAC,WAAW,CAAC,kBAAkB,CAAC,CAAC;IACzD,MAAM,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;AAC9E,CAAC,CAAC,CAAC","sourcesContent":["/*\n * SPDX-FileCopyrightText: 2024 Siemens AG\n *\n * SPDX-License-Identifier: MIT\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { expect } from '@playwright/test';\nimport { regressionTest } from '@utils/test';\n\nregressionTest('renders', async ({ mount, page }) => {\n await mount(`<ix-custom-field></ix-custom-field>`);\n const customFieldElement = page.locator('ix-custom-field');\n await expect(customFieldElement).toHaveClass(/hydrated/);\n});\n\nregressionTest('renders with label', async ({ mount, page }) => {\n await mount(`<ix-custom-field label=\"Label\"><input /></ix-custom-field>`);\n const customFieldElement = page.locator('ix-custom-field');\n const fieldLabel = customFieldElement.locator('ix-field-label');\n const typography = fieldLabel.locator('label').locator('ix-typography');\n await expect(customFieldElement).toHaveClass(/hydrated/);\n await expect(fieldLabel).toHaveClass(/hydrated/);\n await expect(typography).toHaveClass(/typography-label/);\n await expect(fieldLabel.filter({ hasText: 'Label' })).toHaveText('Label');\n});\n\nregressionTest('renders with helper-text', async ({ mount, page }) => {\n await mount(\n `<ix-custom-field helper-text=\"Some helper text\" invalid-text=\"Error\"></ix-custom-field>`\n );\n const customFieldElement = page.locator('ix-custom-field');\n const fieldWrapper = customFieldElement.locator('ix-field-wrapper');\n await expect(customFieldElement).toHaveClass(/hydrated/);\n await expect(fieldWrapper).toHaveClass(/hydrated/);\n await expect(fieldWrapper.filter({ hasText: 'Some helper text' })).toHaveText(\n 'Some helper text'\n );\n});\n\nregressionTest('renders with invalid-text', async ({ mount, page }) => {\n await mount(\n `<ix-custom-field helper-text=\"Some helper text\" invalid-text=\"Error\">\n <input class=\"ix-invalid\" />\n </ix-custom-field>`\n );\n const customFieldElement = page.locator('ix-custom-field');\n const fieldWrapper = customFieldElement.locator('ix-field-wrapper');\n await expect(customFieldElement).toHaveClass(/hydrated/);\n await expect(fieldWrapper).toHaveClass(/hydrated/);\n await expect(fieldWrapper.filter({ hasText: 'Error' })).toHaveText('Error');\n});\n\nregressionTest(\n 'renders with invalid-text if on child is invalid',\n async ({ mount, page }) => {\n await mount(\n `<ix-custom-field helper-text=\"Some helper text\" invalid-text=\"Error\">\n <input />\n <div data-testid=\"custom\">Some custom</div>\n </ix-custom-field>`\n );\n const customFieldElement = page.locator('ix-custom-field');\n const fieldWrapper = customFieldElement.locator('ix-field-wrapper');\n await expect(customFieldElement).toHaveClass(/hydrated/);\n await expect(fieldWrapper).toHaveClass(/hydrated/);\n await expect(\n fieldWrapper.filter({ hasText: 'Some helper text' })\n ).toHaveText('Some helper text');\n\n const custom = customFieldElement.getByTestId('custom');\n custom.evaluate((node) => node.classList.add('ix-invalid'));\n\n await expect(fieldWrapper.filter({ hasText: 'Error' })).toHaveText('Error');\n }\n);\n\nregressionTest('renders with required label', async ({ mount, page }) => {\n await mount(\n `<ix-custom-field label=\"Label\" required><input/></ix-custom-field>`\n );\n const customFieldElement = page.locator('ix-custom-field');\n const fieldLabel = customFieldElement.locator('ix-field-label');\n const typography = fieldLabel.locator('label').locator('ix-typography');\n await expect(customFieldElement).toHaveClass(/hydrated/);\n await expect(fieldLabel).toHaveClass(/hydrated/);\n await expect(typography).toHaveClass(/typography-label/);\n await expect(fieldLabel.filter({ hasText: 'Label*' })).toHaveText('Label*');\n});\n"]}
|
|
@@ -1,215 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* SPDX-FileCopyrightText: 2023 Siemens AG
|
|
3
|
-
*
|
|
4
|
-
* SPDX-License-Identifier: MIT
|
|
5
|
-
*
|
|
6
|
-
* This source code is licensed under the MIT license found in the
|
|
7
|
-
* LICENSE file in the root directory of this source tree.
|
|
8
|
-
*/
|
|
9
|
-
import { expect } from "@playwright/test";
|
|
10
|
-
import { regressionTest } from "../../../tests/utils/test/index";
|
|
11
|
-
import { DateTime } from "luxon";
|
|
12
|
-
const DATE_DROPDOWN_SELECTOR = 'ix-date-dropdown';
|
|
13
|
-
regressionTest('renders', async ({ mount, page }) => {
|
|
14
|
-
await mount(`<ix-date-dropdown></ix-date-dropdown>`);
|
|
15
|
-
const dateDropdown = page.locator(DATE_DROPDOWN_SELECTOR);
|
|
16
|
-
await expect(dateDropdown).toHaveClass(/hydrated/);
|
|
17
|
-
});
|
|
18
|
-
regressionTest.describe('date dropdown tests', () => {
|
|
19
|
-
regressionTest.beforeEach(async ({ mount, page }) => {
|
|
20
|
-
await mount(`<ix-date-dropdown from="2023/11/01"></ix-date-dropdown>`);
|
|
21
|
-
const today = DateTime.now();
|
|
22
|
-
const format = 'yyyy/LL/dd';
|
|
23
|
-
const prevWeek = today.minus({
|
|
24
|
-
day: 7,
|
|
25
|
-
});
|
|
26
|
-
const dateDropdown = page.locator('ix-date-dropdown');
|
|
27
|
-
const rangeOptions = [
|
|
28
|
-
{
|
|
29
|
-
id: 'no-time',
|
|
30
|
-
label: 'No time limit',
|
|
31
|
-
// TODO (IX-1870): refactor event signatures to match internal logic with undefined values
|
|
32
|
-
from: undefined,
|
|
33
|
-
to: today.toFormat(format),
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
id: 'today',
|
|
37
|
-
label: 'Today',
|
|
38
|
-
from: today.toFormat(format),
|
|
39
|
-
to: today.toFormat(format),
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
id: 'last-7-days',
|
|
43
|
-
label: 'Last 7 days',
|
|
44
|
-
from: today
|
|
45
|
-
.minus({
|
|
46
|
-
day: 7,
|
|
47
|
-
})
|
|
48
|
-
.toFormat(format),
|
|
49
|
-
to: today.toFormat(format),
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
id: 'last-week',
|
|
53
|
-
label: 'Last week',
|
|
54
|
-
from: prevWeek.startOf('week').toFormat(format),
|
|
55
|
-
to: prevWeek.endOf('week').toFormat(format),
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
id: 'current-month',
|
|
59
|
-
label: 'Current month',
|
|
60
|
-
from: today.startOf('month').toFormat(format),
|
|
61
|
-
to: today.endOf('month').toFormat(format),
|
|
62
|
-
},
|
|
63
|
-
];
|
|
64
|
-
await dateDropdown.evaluate((el, [dateRangeOptions]) => {
|
|
65
|
-
const elementToTest = el;
|
|
66
|
-
elementToTest.dateRangeId = 'today';
|
|
67
|
-
elementToTest.customRangeAllowed = true;
|
|
68
|
-
elementToTest.dateRangeOptions = dateRangeOptions;
|
|
69
|
-
}, [rangeOptions]);
|
|
70
|
-
});
|
|
71
|
-
regressionTest('select different date interval and get date', async ({ page }) => {
|
|
72
|
-
const dateDropdown = page.locator('ix-date-dropdown');
|
|
73
|
-
await dateDropdown.click();
|
|
74
|
-
const intervalOptionsButton = dateDropdown.getByRole('button', {
|
|
75
|
-
name: 'Last 7 days',
|
|
76
|
-
});
|
|
77
|
-
await intervalOptionsButton.click();
|
|
78
|
-
const button = dateDropdown.locator('ix-button');
|
|
79
|
-
await expect(button).toContainText(/Last 7 days/);
|
|
80
|
-
const selectedDateRange = await dateDropdown.evaluate((el) => el.getDateRange());
|
|
81
|
-
const endDate = DateTime.now();
|
|
82
|
-
const startDate = endDate.minus({
|
|
83
|
-
day: 7,
|
|
84
|
-
});
|
|
85
|
-
expect(selectedDateRange).toStrictEqual({
|
|
86
|
-
from: startDate.toFormat('yyyy/LL/dd'),
|
|
87
|
-
to: endDate.toFormat('yyyy/LL/dd'),
|
|
88
|
-
id: 'last-7-days',
|
|
89
|
-
label: 'Last 7 days',
|
|
90
|
-
});
|
|
91
|
-
});
|
|
92
|
-
regressionTest('select custom date interval and get time', async ({ page }) => {
|
|
93
|
-
const dateDropDownButton = page.locator('ix-date-dropdown');
|
|
94
|
-
await dateDropDownButton.click();
|
|
95
|
-
const dropdown = dateDropDownButton.locator('ix-dropdown');
|
|
96
|
-
await expect(dropdown).toHaveClass(/show/);
|
|
97
|
-
const customItem = dateDropDownButton.getByText('Custom...');
|
|
98
|
-
await customItem.click();
|
|
99
|
-
const datepicker = dateDropDownButton.locator('ix-date-picker');
|
|
100
|
-
await expect(datepicker).toBeVisible();
|
|
101
|
-
const startDay = datepicker
|
|
102
|
-
.locator('[date-calender-day]')
|
|
103
|
-
.getByText('3', { exact: true });
|
|
104
|
-
const endDay = datepicker
|
|
105
|
-
.locator('[date-calender-day]')
|
|
106
|
-
.getByText('11', { exact: true });
|
|
107
|
-
await startDay.click();
|
|
108
|
-
await endDay.click();
|
|
109
|
-
const dateDoneButton = dateDropDownButton.getByRole('button', {
|
|
110
|
-
name: 'Done',
|
|
111
|
-
});
|
|
112
|
-
await dateDoneButton.click();
|
|
113
|
-
await expect(datepicker).not.toBeVisible();
|
|
114
|
-
const button = dateDropDownButton.locator('[data-date-dropdown-trigger]');
|
|
115
|
-
await expect(button).toHaveText(/2023\/11\/03 \- 2023\/11\/11/);
|
|
116
|
-
});
|
|
117
|
-
regressionTest('check if dateRangeChange event is fired', async ({ page }) => {
|
|
118
|
-
const today = DateTime.now();
|
|
119
|
-
const format = 'yyyy/LL/dd';
|
|
120
|
-
const dateDropdown = page.locator('ix-date-dropdown');
|
|
121
|
-
await expect(dateDropdown).toHaveClass(/hydrated/);
|
|
122
|
-
const eventPromise = dateDropdown.evaluate((e) => {
|
|
123
|
-
return new Promise((resolve) => {
|
|
124
|
-
e.addEventListener('dateRangeChange', (event) =>
|
|
125
|
-
// Using JSON.stringify to deserialize js object between chrome instance and test
|
|
126
|
-
resolve(JSON.stringify(event.detail)));
|
|
127
|
-
});
|
|
128
|
-
});
|
|
129
|
-
await dateDropdown.click();
|
|
130
|
-
const intervalOptionsButton = page.locator('ix-dropdown-item div.dropdown-item-text:has-text("Last 7 days")');
|
|
131
|
-
await intervalOptionsButton.click();
|
|
132
|
-
const dateRangeChangeEvent = await eventPromise;
|
|
133
|
-
expect(JSON.parse(dateRangeChangeEvent)).toStrictEqual({
|
|
134
|
-
from: today
|
|
135
|
-
.minus({
|
|
136
|
-
day: 7,
|
|
137
|
-
})
|
|
138
|
-
.toFormat(format),
|
|
139
|
-
to: today.toFormat(format),
|
|
140
|
-
id: 'last-7-days',
|
|
141
|
-
label: 'Last 7 days',
|
|
142
|
-
});
|
|
143
|
-
});
|
|
144
|
-
regressionTest('check initial date', async ({ page }) => {
|
|
145
|
-
const dateDropDownButton = page.locator(DATE_DROPDOWN_SELECTOR);
|
|
146
|
-
await expect(dateDropDownButton).toHaveClass(/hydrated/);
|
|
147
|
-
const initialSetDate = await dateDropDownButton.evaluate((el) => el.getDateRange());
|
|
148
|
-
const endDate = DateTime.now();
|
|
149
|
-
const startDate = endDate;
|
|
150
|
-
expect(initialSetDate).toEqual({
|
|
151
|
-
from: startDate.toFormat('yyyy/LL/dd'),
|
|
152
|
-
to: endDate.toFormat('yyyy/LL/dd'),
|
|
153
|
-
id: 'today',
|
|
154
|
-
label: 'Today',
|
|
155
|
-
});
|
|
156
|
-
});
|
|
157
|
-
});
|
|
158
|
-
regressionTest('set date from a button', async ({ mount, page }) => {
|
|
159
|
-
await mount(`<ix-date-dropdown from="2024/02/16"></ix-date-dropdown><ix-button id="set-tomorrow"></ix-button>`);
|
|
160
|
-
const dateDropdown = page.locator(DATE_DROPDOWN_SELECTOR);
|
|
161
|
-
const setButton = page.locator('#set-tomorrow');
|
|
162
|
-
await expect(dateDropdown).toHaveClass(/hydrated/);
|
|
163
|
-
await setButton.click();
|
|
164
|
-
await dateDropdown.evaluate((el) => {
|
|
165
|
-
el.from = '2024/02/17';
|
|
166
|
-
el.to = '2024/02/27';
|
|
167
|
-
return el.getDateRange();
|
|
168
|
-
});
|
|
169
|
-
const button = dateDropdown.locator('[data-date-dropdown-trigger]');
|
|
170
|
-
await expect(button).toHaveText(/2024\/02\/17 \- 2024\/02\/27/);
|
|
171
|
-
});
|
|
172
|
-
regressionTest('select different year', async ({ mount, page }) => {
|
|
173
|
-
await mount(`<ix-date-dropdown from="2024/02/16"></ix-date-dropdown>`);
|
|
174
|
-
const dateDropdown = page.locator(DATE_DROPDOWN_SELECTOR);
|
|
175
|
-
await expect(dateDropdown).toHaveClass(/hydrated/);
|
|
176
|
-
await expect(dateDropdown).toBeVisible();
|
|
177
|
-
const dateDropdownTrigger = dateDropdown.getByTestId('date-dropdown-trigger');
|
|
178
|
-
await dateDropdownTrigger.click();
|
|
179
|
-
await expect(dateDropdownTrigger).toBeVisible();
|
|
180
|
-
const datePickerDropdown = dateDropdown.getByTestId('date-dropdown');
|
|
181
|
-
await expect(datePickerDropdown).toBeVisible();
|
|
182
|
-
const datepicker = datePickerDropdown.locator('ix-date-picker');
|
|
183
|
-
const yearMonthButton = datepicker.getByTestId('year-month-button');
|
|
184
|
-
await yearMonthButton.click();
|
|
185
|
-
const yearMonthDropdown = datepicker.getByTestId('year-month-dropdown');
|
|
186
|
-
await expect(yearMonthDropdown).toBeVisible();
|
|
187
|
-
const yearContainer = yearMonthDropdown.getByTestId('year-container');
|
|
188
|
-
const year2020 = yearContainer.getByText('2020');
|
|
189
|
-
await year2020.click();
|
|
190
|
-
const monthContainer = yearMonthDropdown.getByTestId('month-container');
|
|
191
|
-
const march2020 = monthContainer.getByText('March 2020');
|
|
192
|
-
await march2020.click();
|
|
193
|
-
await expect(yearMonthDropdown).not.toBeVisible();
|
|
194
|
-
await expect(yearMonthButton).toHaveText('March 2020');
|
|
195
|
-
});
|
|
196
|
-
regressionTest('disable', async ({ mount, page }) => {
|
|
197
|
-
await mount(`<ix-date-dropdown disabled></ix-date-dropdown>`);
|
|
198
|
-
const dateDropdown = page.locator('ix-date-dropdown');
|
|
199
|
-
const trigger = page.locator('[data-date-dropdown-trigger]');
|
|
200
|
-
await expect(trigger).toHaveAttribute('disabled');
|
|
201
|
-
await dateDropdown.click();
|
|
202
|
-
const dropdown = dateDropdown.locator('[data-date-dropdown]');
|
|
203
|
-
await expect(dropdown).not.toBeVisible();
|
|
204
|
-
});
|
|
205
|
-
regressionTest('close dropdown after disabled property = true', async ({ mount, page }) => {
|
|
206
|
-
await mount(`<ix-date-dropdown></ix-date-dropdown>`);
|
|
207
|
-
const dateDropdown = page.locator('ix-date-dropdown');
|
|
208
|
-
await dateDropdown.click();
|
|
209
|
-
await dateDropdown.evaluate((dd) => {
|
|
210
|
-
dd.disabled = true;
|
|
211
|
-
});
|
|
212
|
-
const dropdown = dateDropdown.locator('[data-date-dropdown]');
|
|
213
|
-
await expect(dropdown).not.toBeVisible();
|
|
214
|
-
});
|
|
215
|
-
//# sourceMappingURL=date-dropdown.ct.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"date-dropdown.ct.js","sourceRoot":"","sources":["../../../../src/components/date-dropdown/test/date-dropdown.ct.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGjC,MAAM,sBAAsB,GAAG,kBAAkB,CAAC;AAElD,cAAc,CAAC,SA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H,cAAc,CAAC,SAAS,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE;IAClD,MAAM,KAAK,CAAC,gDAAgD,CAAC,CAAC;IAC9D,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAEtD,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,8BAA8B,CAAC,CAAC;IAC7D,MAAM,MAAM,CAAC,OAAO,CAAC,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC;IAElD,MAAM,YAAY,CAAC,KAAK,EAAE,CAAC;IAE3B,MAAM,QAAQ,GAAG,YAAY,CAAC,OAAO,CAAC,sBAAsB,CAAC,CAAC;IAC9D,MAAM,MAAM,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC;AAC3C,CAAC,CAAC,CAAC;AAEH,cAAc,CACZ,+CAA+C,EAC/C,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE;IACxB,MAAM,KAAK,CAAC,uCAAuC,CAAC,CAAC;IACrD,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;IACtD,MAAM,YAAY,CAAC,KAAK,EAAE,CAAC;IAC3B,MAAM,YAAY,CAAC,QAAQ,CAAC,CAAC,EAA6B,EAAE,EAAE;QAC5D,EAAE,CAAC,QAAQ,GAAG,IAAI,CAAC;IACrB,CAAC,CAAC,CAAC;IACH,MAAM,QAAQ,GAAG,YAAY,CAAC,OAAO,CAAC,sBAAsB,CAAC,CAAC;IAC9D,MAAM,MAAM,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC;AAC3C,CAAC,CACF,CAAC","sourcesContent":["/*\n * SPDX-FileCopyrightText: 2023 Siemens AG\n *\n * SPDX-License-Identifier: MIT\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { expect } from '@playwright/test';\nimport { regressionTest } from '@utils/test';\nimport { DateTime } from 'luxon';\nimport { DateDropdownOption } from '../date-dropdown.types';\n\nconst DATE_DROPDOWN_SELECTOR = 'ix-date-dropdown';\n\nregressionTest('renders', async ({ mount, page }) => {\n await mount(`<ix-date-dropdown></ix-date-dropdown>`);\n const dateDropdown = page.locator(DATE_DROPDOWN_SELECTOR);\n await expect(dateDropdown).toHaveClass(/hydrated/);\n});\n\nregressionTest.describe('date dropdown tests', () => {\n regressionTest.beforeEach(async ({ mount, page }) => {\n await mount(`<ix-date-dropdown from=\"2023/11/01\"></ix-date-dropdown>`);\n\n const today = DateTime.now();\n const format = 'yyyy/LL/dd';\n const prevWeek = today.minus({\n day: 7,\n });\n\n const dateDropdown = page.locator('ix-date-dropdown');\n\n const rangeOptions: DateDropdownOption[] = [\n {\n id: 'no-time',\n label: 'No time limit',\n // TODO (IX-1870): refactor event signatures to match internal logic with undefined values\n from: undefined as any,\n to: today.toFormat(format),\n },\n {\n id: 'today',\n label: 'Today',\n from: today.toFormat(format),\n to: today.toFormat(format),\n },\n {\n id: 'last-7-days',\n label: 'Last 7 days',\n from: today\n .minus({\n day: 7,\n })\n .toFormat(format),\n to: today.toFormat(format),\n },\n {\n id: 'last-week',\n label: 'Last week',\n from: prevWeek.startOf('week').toFormat(format),\n to: prevWeek.endOf('week').toFormat(format),\n },\n {\n id: 'current-month',\n label: 'Current month',\n from: today.startOf('month').toFormat(format),\n to: today.endOf('month').toFormat(format),\n },\n ];\n\n await dateDropdown.evaluate(\n (el, [dateRangeOptions]) => {\n const elementToTest = el as HTMLIxDateDropdownElement;\n\n elementToTest.dateRangeId = 'today';\n elementToTest.customRangeAllowed = true;\n elementToTest.dateRangeOptions = dateRangeOptions;\n },\n [rangeOptions]\n );\n });\n\n regressionTest(\n 'select different date interval and get date',\n async ({ page }) => {\n const dateDropdown = page.locator('ix-date-dropdown');\n await dateDropdown.click();\n\n const intervalOptionsButton = dateDropdown.getByRole('button', {\n name: 'Last 7 days',\n });\n await intervalOptionsButton.click();\n\n const button = dateDropdown.locator('ix-button');\n await expect(button).toContainText(/Last 7 days/);\n\n const selectedDateRange = await dateDropdown.evaluate(\n (el: HTMLIxDateDropdownElement) => el.getDateRange()\n );\n const endDate = DateTime.now();\n const startDate = endDate.minus({\n day: 7,\n });\n\n expect(selectedDateRange).toStrictEqual({\n from: startDate.toFormat('yyyy/LL/dd'),\n to: endDate.toFormat('yyyy/LL/dd'),\n id: 'last-7-days',\n label: 'Last 7 days',\n });\n }\n );\n\n regressionTest(\n 'select custom date interval and get time',\n async ({ page }) => {\n const dateDropDownButton = page.locator('ix-date-dropdown');\n await dateDropDownButton.click();\n\n const dropdown = dateDropDownButton.locator('ix-dropdown');\n await expect(dropdown).toHaveClass(/show/);\n\n const customItem = dateDropDownButton.getByText('Custom...');\n await customItem.click();\n\n const datepicker = dateDropDownButton.locator('ix-date-picker');\n await expect(datepicker).toBeVisible();\n\n const startDay = datepicker\n .locator('[date-calender-day]')\n .getByText('3', { exact: true });\n const endDay = datepicker\n .locator('[date-calender-day]')\n .getByText('11', { exact: true });\n\n await startDay.click();\n await endDay.click();\n\n const dateDoneButton = dateDropDownButton.getByRole('button', {\n name: 'Done',\n });\n\n await dateDoneButton.click();\n await expect(datepicker).not.toBeVisible();\n\n const button = dateDropDownButton.locator('[data-date-dropdown-trigger]');\n await expect(button).toHaveText(/2023\\/11\\/03 \\- 2023\\/11\\/11/);\n }\n );\n\n regressionTest(\n 'check if dateRangeChange event is fired',\n async ({ page }) => {\n const today = DateTime.now();\n const format = 'yyyy/LL/dd';\n\n const dateDropdown = page.locator('ix-date-dropdown');\n await expect(dateDropdown).toHaveClass(/hydrated/);\n\n const eventPromise = dateDropdown.evaluate((e) => {\n return new Promise<any>((resolve) => {\n e.addEventListener('dateRangeChange', (event: any) =>\n // Using JSON.stringify to deserialize js object between chrome instance and test\n resolve(JSON.stringify(event.detail))\n );\n });\n });\n\n await dateDropdown.click();\n const intervalOptionsButton = page.locator(\n 'ix-dropdown-item div.dropdown-item-text:has-text(\"Last 7 days\")'\n );\n await intervalOptionsButton.click();\n\n const dateRangeChangeEvent = await eventPromise;\n expect(JSON.parse(dateRangeChangeEvent)).toStrictEqual({\n from: today\n .minus({\n day: 7,\n })\n .toFormat(format),\n to: today.toFormat(format),\n id: 'last-7-days',\n label: 'Last 7 days',\n });\n }\n );\n\n regressionTest('check initial date', async ({ page }) => {\n const dateDropDownButton = page.locator(DATE_DROPDOWN_SELECTOR);\n await expect(dateDropDownButton).toHaveClass(/hydrated/);\n\n const initialSetDate = await dateDropDownButton.evaluate(\n (el: HTMLIxDateDropdownElement) => el.getDateRange()\n );\n\n const endDate = DateTime.now();\n const startDate = endDate;\n\n expect(initialSetDate).toEqual({\n from: startDate.toFormat('yyyy/LL/dd'),\n to: endDate.toFormat('yyyy/LL/dd'),\n id: 'today',\n label: 'Today',\n });\n });\n});\n\nregressionTest('set date from a button', async ({ mount, page }) => {\n await mount(\n `<ix-date-dropdown from=\"2024/02/16\"></ix-date-dropdown><ix-button id=\"set-tomorrow\"></ix-button>`\n );\n const dateDropdown = page.locator(DATE_DROPDOWN_SELECTOR);\n const setButton = page.locator('#set-tomorrow');\n await expect(dateDropdown).toHaveClass(/hydrated/);\n\n await setButton.click();\n\n await dateDropdown.evaluate((el: HTMLIxDateDropdownElement) => {\n el.from = '2024/02/17';\n el.to = '2024/02/27';\n return el.getDateRange();\n });\n const button = dateDropdown.locator('[data-date-dropdown-trigger]');\n await expect(button).toHaveText(/2024\\/02\\/17 \\- 2024\\/02\\/27/);\n});\n\nregressionTest('select different year', async ({ mount, page }) => {\n await mount(`<ix-date-dropdown from=\"2024/02/16\"></ix-date-dropdown>`);\n const dateDropdown = page.locator(DATE_DROPDOWN_SELECTOR);\n\n await expect(dateDropdown).toHaveClass(/hydrated/);\n await expect(dateDropdown).toBeVisible();\n\n const dateDropdownTrigger = dateDropdown.getByTestId('date-dropdown-trigger');\n await dateDropdownTrigger.click();\n await expect(dateDropdownTrigger).toBeVisible();\n\n const datePickerDropdown = dateDropdown.getByTestId('date-dropdown');\n await expect(datePickerDropdown).toBeVisible();\n\n const datepicker = datePickerDropdown.locator('ix-date-picker');\n const yearMonthButton = datepicker.getByTestId('year-month-button');\n await yearMonthButton.click();\n\n const yearMonthDropdown = datepicker.getByTestId('year-month-dropdown');\n await expect(yearMonthDropdown).toBeVisible();\n\n const yearContainer = yearMonthDropdown.getByTestId('year-container');\n const year2020 = yearContainer.getByText('2020');\n\n await year2020.click();\n\n const monthContainer = yearMonthDropdown.getByTestId('month-container');\n const march2020 = monthContainer.getByText('March 2020');\n\n await march2020.click();\n\n await expect(yearMonthDropdown).not.toBeVisible();\n await expect(yearMonthButton).toHaveText('March 2020');\n});\n\nregressionTest('disable', async ({ mount, page }) => {\n await mount(`<ix-date-dropdown disabled></ix-date-dropdown>`);\n const dateDropdown = page.locator('ix-date-dropdown');\n\n const trigger = page.locator('[data-date-dropdown-trigger]');\n await expect(trigger).toHaveAttribute('disabled');\n\n await dateDropdown.click();\n\n const dropdown = dateDropdown.locator('[data-date-dropdown]');\n await expect(dropdown).not.toBeVisible();\n});\n\nregressionTest(\n 'close dropdown after disabled property = true',\n async ({ mount, page }) => {\n await mount(`<ix-date-dropdown></ix-date-dropdown>`);\n const dateDropdown = page.locator('ix-date-dropdown');\n await dateDropdown.click();\n await dateDropdown.evaluate((dd: HTMLIxDateDropdownElement) => {\n dd.disabled = true;\n });\n const dropdown = dateDropdown.locator('[data-date-dropdown]');\n await expect(dropdown).not.toBeVisible();\n }\n);\n"]}
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* SPDX-FileCopyrightText: 2024 Siemens AG
|
|
3
|
-
*
|
|
4
|
-
* SPDX-License-Identifier: MIT
|
|
5
|
-
*
|
|
6
|
-
* This source code is licensed under the MIT license found in the
|
|
7
|
-
* LICENSE file in the root directory of this source tree.
|
|
8
|
-
*/
|
|
9
|
-
import { expect } from "@playwright/test";
|
|
10
|
-
import { getFormValue, preventFormSubmission, regressionTest, } from "../../../tests/utils/test/index";
|
|
11
|
-
const createDateInputAccessor = async (dateInput) => {
|
|
12
|
-
const handle = {
|
|
13
|
-
openByCalender: async () => {
|
|
14
|
-
const trigger = dateInput.getByTestId('open-calendar');
|
|
15
|
-
await trigger.click();
|
|
16
|
-
},
|
|
17
|
-
selectDay: async (day) => {
|
|
18
|
-
const dayButton = dateInput
|
|
19
|
-
.locator('ix-dropdown')
|
|
20
|
-
.filter({ hasText: day.toString() })
|
|
21
|
-
.getByText(day.toString());
|
|
22
|
-
await dayButton.click();
|
|
23
|
-
},
|
|
24
|
-
};
|
|
25
|
-
return handle;
|
|
26
|
-
};
|
|
27
|
-
regressionTest('renders', async ({ mount, page }) => {
|
|
28
|
-
await mount(`<ix-date-input value="2024/05/05"></ix-date-input>`);
|
|
29
|
-
const dateInputElement = page.locator('ix-date-input');
|
|
30
|
-
await expect(dateInputElement).toHaveClass(/hydrated/);
|
|
31
|
-
});
|
|
32
|
-
regressionTest('select date by open calendar trigger', async ({ mount, page }) => {
|
|
33
|
-
await mount(`<ix-date-input value="2024/05/05"></ix-date-input>`);
|
|
34
|
-
const dateInputElement = page.locator('ix-date-input');
|
|
35
|
-
await expect(dateInputElement).toHaveClass(/hydrated/);
|
|
36
|
-
const dateInput = await createDateInputAccessor(dateInputElement);
|
|
37
|
-
await dateInput.openByCalender();
|
|
38
|
-
await dateInput.selectDay(10);
|
|
39
|
-
await expect(dateInputElement).toHaveAttribute('value', '2024/05/10');
|
|
40
|
-
});
|
|
41
|
-
regressionTest('select date by focus', async ({ mount, page }) => {
|
|
42
|
-
await mount(`<ix-date-input value="2024/05/05"></ix-date-input>`);
|
|
43
|
-
const dateInputElement = page.locator('ix-date-input');
|
|
44
|
-
await expect(dateInputElement).toHaveClass(/hydrated/);
|
|
45
|
-
const dateInput = await createDateInputAccessor(dateInputElement);
|
|
46
|
-
await dateInputElement.locator('input').focus();
|
|
47
|
-
await dateInput.selectDay(10);
|
|
48
|
-
await expect(dateInputElement).toHaveAttribute('value', '2024/05/10');
|
|
49
|
-
await expect(dateInputElement.getByTestId('date-dropdown')).not.toHaveClass(/show/);
|
|
50
|
-
});
|
|
51
|
-
regressionTest('select date by input', async ({ mount, page }) => {
|
|
52
|
-
await mount(`<ix-date-input value="2024/05/05"></ix-date-input>`);
|
|
53
|
-
const dateInputElement = page.locator('ix-date-input');
|
|
54
|
-
await expect(dateInputElement).toHaveClass(/hydrated/);
|
|
55
|
-
const dateInput = await createDateInputAccessor(dateInputElement);
|
|
56
|
-
await dateInputElement.locator('input').focus();
|
|
57
|
-
await expect(dateInputElement.getByTestId('date-dropdown')).toHaveClass(/show/);
|
|
58
|
-
await dateInputElement.locator('input').fill('2025/10/10');
|
|
59
|
-
await expect(dateInputElement.getByTestId('date-dropdown')).not.toHaveClass(/show/);
|
|
60
|
-
await expect(dateInputElement).toHaveAttribute('value', '2025/10/10');
|
|
61
|
-
await dateInput.openByCalender();
|
|
62
|
-
await expect(dateInputElement.locator('.calendar-item.selected')).toHaveText('10');
|
|
63
|
-
});
|
|
64
|
-
regressionTest('select date by input with invalid date', async ({ mount, page }) => {
|
|
65
|
-
await mount(`<ix-date-input value="2024/05/05"></ix-date-input>`);
|
|
66
|
-
const dateInputElement = page.locator('ix-date-input');
|
|
67
|
-
await expect(dateInputElement).toHaveClass(/hydrated/);
|
|
68
|
-
const dateInput = await createDateInputAccessor(dateInputElement);
|
|
69
|
-
await dateInputElement.locator('input').fill('2025/10/10/10');
|
|
70
|
-
await dateInput.openByCalender();
|
|
71
|
-
await expect(dateInputElement).toHaveAttribute('value', '2025/10/10/10');
|
|
72
|
-
await expect(dateInputElement
|
|
73
|
-
.locator('ix-field-wrapper')
|
|
74
|
-
.locator('ix-typography')
|
|
75
|
-
.filter({ hasText: 'Date is not valid' })).toHaveText('Date is not valid');
|
|
76
|
-
});
|
|
77
|
-
regressionTest('select date by input with invalid date - i18n', async ({ mount, page }) => {
|
|
78
|
-
await mount(`<ix-date-input value="2024/05/05" i18n-error-date-unparsable="Datum nicht korrekt!"></ix-date-input>`);
|
|
79
|
-
const dateInputElement = page.locator('ix-date-input');
|
|
80
|
-
await expect(dateInputElement).toHaveClass(/hydrated/);
|
|
81
|
-
const dateInput = await createDateInputAccessor(dateInputElement);
|
|
82
|
-
await dateInputElement.locator('input').fill('2025/10/10/10');
|
|
83
|
-
await dateInput.openByCalender();
|
|
84
|
-
await expect(dateInputElement).toHaveAttribute('value', '2025/10/10/10');
|
|
85
|
-
await expect(dateInputElement
|
|
86
|
-
.locator('ix-field-wrapper')
|
|
87
|
-
.locator('ix-typography')
|
|
88
|
-
.filter({ hasText: 'Datum nicht korrekt!' })).toHaveText('Datum nicht korrekt!');
|
|
89
|
-
});
|
|
90
|
-
regressionTest('required', async ({ mount, page }) => {
|
|
91
|
-
await mount(`<ix-date-input required label="MyLabel"></ix-date-input>`);
|
|
92
|
-
const dateInputElement = page.locator('ix-date-input');
|
|
93
|
-
const input = dateInputElement.locator('input');
|
|
94
|
-
await expect(dateInputElement).toHaveAttribute('required');
|
|
95
|
-
await expect(dateInputElement.locator('ix-field-label')).toHaveText('MyLabel*');
|
|
96
|
-
await input.focus();
|
|
97
|
-
await input.blur();
|
|
98
|
-
await expect(dateInputElement).toHaveClass(/ix-invalid--required/);
|
|
99
|
-
});
|
|
100
|
-
regressionTest(`form-ready - ix-date-input`, async ({ mount, page }) => {
|
|
101
|
-
await mount(`<form><ix-date-input name="my-field-name"></ix-date-input></form>`);
|
|
102
|
-
const formElement = page.locator('form');
|
|
103
|
-
preventFormSubmission(formElement);
|
|
104
|
-
const input = page.locator('ix-date-input').locator('input');
|
|
105
|
-
await input.fill('2024/05/05');
|
|
106
|
-
await input.blur();
|
|
107
|
-
const formData = await getFormValue(formElement, 'my-field-name', page);
|
|
108
|
-
expect(formData).toBe('2024/05/05');
|
|
109
|
-
});
|
|
110
|
-
regressionTest(`form-ready - ix-date-input initial value`, async ({ mount, page }) => {
|
|
111
|
-
await mount(`<form><ix-date-input name="my-field-name" value="2024/12/12"></ix-date-input></form>`);
|
|
112
|
-
const formElement = page.locator('form');
|
|
113
|
-
preventFormSubmission(formElement);
|
|
114
|
-
const formData = await getFormValue(formElement, 'my-field-name', page);
|
|
115
|
-
expect(formData).toBe('2024/12/12');
|
|
116
|
-
});
|
|
117
|
-
//# sourceMappingURL=date-input.ct.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"date-input.ct.js","sourceRoot":"","sources":["../../../../src/components/date-input/tests/date-input.ct.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAW,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EACL,YAAY,EACZ,qBAAqB,EACrB,cAAc,GACf,MAAM,aAAa,CAAC;AAErB,MAAM,uBAAuB,GAAG,KAAK,EAAE,SAAkB,EAAE,EAAE;IAC3D,MAAM,MAAM,GAAG;QACb,cAAc,EAAE,KAAK,IAAI,EAAE;YACzB,MAAM,OAAO,GAAG,SAAS,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC;YACvD,MAAM,OAAO,CAAC,KAAK,EAAE,CAAC;QACxB,CAAC;QACD,SAAS,EAAE,KAAK,EAAE,GAAW,EAAE,EAAE;YAC/B,MAAM,SAAS,GAAG,SAAS;iBACxB,OAAO,CAAC,aAAa,CAAC;iBACtB,MAAM,CAAC,EAAE,OAAO,EAAE,GAAG,CAAC,QAAQ,EAAE,EAAE,CAAC;iBACnC,SAAS,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC;YAC7B,MAAM,SAAS,CAAC,KAAK,EAAE,CAAC;QAC1B,CAAC;KACF,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAEF,cAAc,CAAC,SAAS,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE;IAClD,MAAM,KAAK,CAAC,oDAAoD,CAAC,CAAC;IAClE,MAAM,gBAAgB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CAAC,YAAY,CAAC,CAAC;IAC/B,MAAM,KAAK,CAAC,IAAI,EAAE,CAAC;IAEnB,MAAM,QAAQ,GAAG,MAAM,YAAY,CAAC,WAAW,EAAE,eAAe,EAAE,IAAI,CAAC,CAAC;IACxE,MAAM,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;AACtC,CAAC,CAAC,CAAC;AAEH,cAAc,CACZ,0CAA0C,EAC1C,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE;IACxB,MAAM,KAAK,CACT,sFAAsF,CACvF,CAAC;IAEF,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IACzC,qBAAqB,CAAC,WAAW,CAAC,CAAC;IACnC,MAAM,QAAQ,GAAG,MAAM,YAAY,CAAC,WAAW,EAAE,eAAe,EAAE,IAAI,CAAC,CAAC;IACxE,MAAM,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;AACtC,CAAC,CACF,CAAC","sourcesContent":["/*\n * SPDX-FileCopyrightText: 2024 Siemens AG\n *\n * SPDX-License-Identifier: MIT\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { Locator, expect } from '@playwright/test';\nimport {\n getFormValue,\n preventFormSubmission,\n regressionTest,\n} from '@utils/test';\n\nconst createDateInputAccessor = async (dateInput: Locator) => {\n const handle = {\n openByCalender: async () => {\n const trigger = dateInput.getByTestId('open-calendar');\n await trigger.click();\n },\n selectDay: async (day: number) => {\n const dayButton = dateInput\n .locator('ix-dropdown')\n .filter({ hasText: day.toString() })\n .getByText(day.toString());\n await dayButton.click();\n },\n };\n\n return handle;\n};\n\nregressionTest('renders', async ({ mount, page }) => {\n await mount(`<ix-date-input value=\"2024/05/05\"></ix-date-input>`);\n const dateInputElement = page.locator('ix-date-input');\n await expect(dateInputElement).toHaveClass(/hydrated/);\n});\n\nregressionTest(\n 'select date by open calendar trigger',\n async ({ mount, page }) => {\n await mount(`<ix-date-input value=\"2024/05/05\"></ix-date-input>`);\n const dateInputElement = page.locator('ix-date-input');\n await expect(dateInputElement).toHaveClass(/hydrated/);\n\n const dateInput = await createDateInputAccessor(dateInputElement);\n await dateInput.openByCalender();\n\n await dateInput.selectDay(10);\n await expect(dateInputElement).toHaveAttribute('value', '2024/05/10');\n }\n);\n\nregressionTest('select date by focus', async ({ mount, page }) => {\n await mount(`<ix-date-input value=\"2024/05/05\"></ix-date-input>`);\n const dateInputElement = page.locator('ix-date-input');\n await expect(dateInputElement).toHaveClass(/hydrated/);\n\n const dateInput = await createDateInputAccessor(dateInputElement);\n await dateInputElement.locator('input').focus();\n\n await dateInput.selectDay(10);\n await expect(dateInputElement).toHaveAttribute('value', '2024/05/10');\n await expect(dateInputElement.getByTestId('date-dropdown')).not.toHaveClass(\n /show/\n );\n});\n\nregressionTest('select date by input', async ({ mount, page }) => {\n await mount(`<ix-date-input value=\"2024/05/05\"></ix-date-input>`);\n const dateInputElement = page.locator('ix-date-input');\n await expect(dateInputElement).toHaveClass(/hydrated/);\n\n const dateInput = await createDateInputAccessor(dateInputElement);\n await dateInputElement.locator('input').focus();\n await expect(dateInputElement.getByTestId('date-dropdown')).toHaveClass(\n /show/\n );\n await dateInputElement.locator('input').fill('2025/10/10');\n\n await expect(dateInputElement.getByTestId('date-dropdown')).not.toHaveClass(\n /show/\n );\n await expect(dateInputElement).toHaveAttribute('value', '2025/10/10');\n\n await dateInput.openByCalender();\n\n await expect(dateInputElement.locator('.calendar-item.selected')).toHaveText(\n '10'\n );\n});\n\nregressionTest(\n 'select date by input with invalid date',\n async ({ mount, page }) => {\n await mount(`<ix-date-input value=\"2024/05/05\"></ix-date-input>`);\n const dateInputElement = page.locator('ix-date-input');\n await expect(dateInputElement).toHaveClass(/hydrated/);\n\n const dateInput = await createDateInputAccessor(dateInputElement);\n await dateInputElement.locator('input').fill('2025/10/10/10');\n await dateInput.openByCalender();\n await expect(dateInputElement).toHaveAttribute('value', '2025/10/10/10');\n\n await expect(\n dateInputElement\n .locator('ix-field-wrapper')\n .locator('ix-typography')\n .filter({ hasText: 'Date is not valid' })\n ).toHaveText('Date is not valid');\n }\n);\n\nregressionTest(\n 'select date by input with invalid date - i18n',\n async ({ mount, page }) => {\n await mount(\n `<ix-date-input value=\"2024/05/05\" i18n-error-date-unparsable=\"Datum nicht korrekt!\"></ix-date-input>`\n );\n const dateInputElement = page.locator('ix-date-input');\n await expect(dateInputElement).toHaveClass(/hydrated/);\n\n const dateInput = await createDateInputAccessor(dateInputElement);\n await dateInputElement.locator('input').fill('2025/10/10/10');\n await dateInput.openByCalender();\n await expect(dateInputElement).toHaveAttribute('value', '2025/10/10/10');\n\n await expect(\n dateInputElement\n .locator('ix-field-wrapper')\n .locator('ix-typography')\n .filter({ hasText: 'Datum nicht korrekt!' })\n ).toHaveText('Datum nicht korrekt!');\n }\n);\n\nregressionTest('required', async ({ mount, page }) => {\n await mount(`<ix-date-input required label=\"MyLabel\"></ix-date-input>`);\n const dateInputElement = page.locator('ix-date-input');\n const input = dateInputElement.locator('input');\n await expect(dateInputElement).toHaveAttribute('required');\n\n await expect(dateInputElement.locator('ix-field-label')).toHaveText(\n 'MyLabel*'\n );\n\n await input.focus();\n await input.blur();\n\n await expect(dateInputElement).toHaveClass(/ix-invalid--required/);\n});\n\nregressionTest(`form-ready - ix-date-input`, async ({ mount, page }) => {\n await mount(\n `<form><ix-date-input name=\"my-field-name\"></ix-date-input></form>`\n );\n\n const formElement = page.locator('form');\n preventFormSubmission(formElement);\n const input = page.locator('ix-date-input').locator('input');\n await input.fill('2024/05/05');\n await input.blur();\n\n const formData = await getFormValue(formElement, 'my-field-name', page);\n expect(formData).toBe('2024/05/05');\n});\n\nregressionTest(\n `form-ready - ix-date-input initial value`,\n async ({ mount, page }) => {\n await mount(\n `<form><ix-date-input name=\"my-field-name\" value=\"2024/12/12\"></ix-date-input></form>`\n );\n\n const formElement = page.locator('form');\n preventFormSubmission(formElement);\n const formData = await getFormValue(formElement, 'my-field-name', page);\n expect(formData).toBe('2024/12/12');\n }\n);\n"]}
|