@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,274 +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, test } from "../../../tests/utils/test/index";
|
|
11
|
-
regressionTest('renders', async ({ mount, page }) => {
|
|
12
|
-
await mount(`
|
|
13
|
-
<ix-application>
|
|
14
|
-
<ix-menu>
|
|
15
|
-
<ix-menu-category label="Category label">
|
|
16
|
-
<ix-menu-item>Test</ix-menu-item>
|
|
17
|
-
<ix-menu-item>Test</ix-menu-item>
|
|
18
|
-
</ix-menu-category>
|
|
19
|
-
</ix-menu>
|
|
20
|
-
</ix-application>
|
|
21
|
-
`);
|
|
22
|
-
const element = page.locator('ix-menu-category');
|
|
23
|
-
await expect(element).toHaveClass('hydrated');
|
|
24
|
-
});
|
|
25
|
-
regressionTest('should collapse by click', async ({ mount, page }) => {
|
|
26
|
-
await mount(`
|
|
27
|
-
<ix-basic-navigation>
|
|
28
|
-
<ix-menu>
|
|
29
|
-
<ix-menu-category label="Category label">
|
|
30
|
-
<ix-menu-item>Test</ix-menu-item>
|
|
31
|
-
<ix-menu-item>Test 2</ix-menu-item>
|
|
32
|
-
</ix-menu-category>
|
|
33
|
-
</ix-menu>
|
|
34
|
-
</ix-basic-navigation>
|
|
35
|
-
`);
|
|
36
|
-
const categoryItem = page.locator('ix-menu-category');
|
|
37
|
-
const app = page.locator('ix-basic-navigation');
|
|
38
|
-
const expandMenuButton = page
|
|
39
|
-
.locator('ix-menu')
|
|
40
|
-
.locator('ix-menu-expand-icon');
|
|
41
|
-
await app.evaluate((menu) => (menu.breakpoints = ['md']));
|
|
42
|
-
await categoryItem.click();
|
|
43
|
-
const item = page.locator('ix-menu-item').getByText('Test 2');
|
|
44
|
-
await item.evaluate((item) => (item.active = true));
|
|
45
|
-
await expect(item).toHaveClass(/active/);
|
|
46
|
-
await item.click();
|
|
47
|
-
await expandMenuButton.click();
|
|
48
|
-
await expect(categoryItem.locator('.menu-items')).toHaveClass(/menu-items--expanded/);
|
|
49
|
-
await categoryItem.locator('.category-parent').click();
|
|
50
|
-
await expect(categoryItem.locator('.menu-items')).not.toHaveClass(/menu-items--expanded/);
|
|
51
|
-
});
|
|
52
|
-
regressionTest('should expand items', async ({ mount, page }) => {
|
|
53
|
-
await mount(`
|
|
54
|
-
<ix-basic-navigation>
|
|
55
|
-
<ix-menu>
|
|
56
|
-
<ix-menu-category label="Category label">
|
|
57
|
-
<ix-menu-item>Test Item 1</ix-menu-item>
|
|
58
|
-
<ix-menu-item>Test Item 2</ix-menu-item>
|
|
59
|
-
</ix-menu-category>
|
|
60
|
-
</ix-menu>
|
|
61
|
-
</ix-basic-navigation>
|
|
62
|
-
`);
|
|
63
|
-
const menu = page.locator('ix-menu');
|
|
64
|
-
await page
|
|
65
|
-
.locator('ix-basic-navigation')
|
|
66
|
-
.evaluate((menu) => (menu.breakpoints = ['md']));
|
|
67
|
-
const menuButton = menu.locator('ix-menu-expand-icon');
|
|
68
|
-
await menuButton.click();
|
|
69
|
-
const menuCategory = page.locator('ix-menu-category');
|
|
70
|
-
await menuCategory.click();
|
|
71
|
-
await expect(menuCategory.locator('.menu-items')).toHaveClass('menu-items menu-items--expanded');
|
|
72
|
-
const dropdown = menuCategory.locator('ix-dropdown');
|
|
73
|
-
await expect(dropdown).not.toBeVisible();
|
|
74
|
-
});
|
|
75
|
-
regressionTest('should show items as dropdown', async ({ mount, page }) => {
|
|
76
|
-
await mount(`
|
|
77
|
-
<ix-basic-navigation>
|
|
78
|
-
<ix-menu>
|
|
79
|
-
<ix-menu-category label="Category label">
|
|
80
|
-
<ix-menu-item>Test Item 1</ix-menu-item>
|
|
81
|
-
<ix-menu-item>Test Item 2</ix-menu-item>
|
|
82
|
-
</ix-menu-category>
|
|
83
|
-
</ix-menu>
|
|
84
|
-
</ix-basic-navigation>
|
|
85
|
-
`);
|
|
86
|
-
await page.waitForSelector('ix-menu');
|
|
87
|
-
await page
|
|
88
|
-
.locator('ix-basic-navigation')
|
|
89
|
-
.evaluate((menu) => (menu.breakpoints = ['md']));
|
|
90
|
-
const menuCategory = page.locator('ix-menu-category');
|
|
91
|
-
await menuCategory.hover();
|
|
92
|
-
const dropdown = menuCategory.locator('ix-dropdown');
|
|
93
|
-
await expect(dropdown).toBeVisible();
|
|
94
|
-
await expect(menuCategory.locator('.menu-items')).toHaveClass('menu-items menu-items--collapsed');
|
|
95
|
-
const dropdownHeader = dropdown.locator('ix-dropdown-item');
|
|
96
|
-
await expect(dropdownHeader).toHaveText('Category label');
|
|
97
|
-
const itemOne = page.locator('ix-menu-item').nth(0);
|
|
98
|
-
const itemTwo = page.locator('ix-menu-item').nth(1);
|
|
99
|
-
await expect(itemOne).toBeVisible();
|
|
100
|
-
await expect(itemTwo).toBeVisible();
|
|
101
|
-
});
|
|
102
|
-
regressionTest('should collapse category after collapse menu', async ({ mount, page }) => {
|
|
103
|
-
await mount(`
|
|
104
|
-
<ix-basic-navigation>
|
|
105
|
-
<ix-menu>
|
|
106
|
-
<ix-menu-category label="Category label">
|
|
107
|
-
<ix-menu-item>Test Item 1</ix-menu-item>
|
|
108
|
-
<ix-menu-item>Test Item 2</ix-menu-item>
|
|
109
|
-
</ix-menu-category>
|
|
110
|
-
</ix-menu>
|
|
111
|
-
</ix-basic-navigation>
|
|
112
|
-
`);
|
|
113
|
-
await page.waitForSelector('ix-menu');
|
|
114
|
-
const menu = page.locator('ix-menu');
|
|
115
|
-
await page
|
|
116
|
-
.locator('ix-basic-navigation')
|
|
117
|
-
.evaluate((menu) => (menu.breakpoints = ['md']));
|
|
118
|
-
const menuButton = menu.locator('ix-menu-expand-icon');
|
|
119
|
-
await menuButton.click();
|
|
120
|
-
const menuCategory = page.locator('ix-menu-category');
|
|
121
|
-
await menuCategory.click();
|
|
122
|
-
await expect(menuCategory.locator('.menu-items')).toHaveClass('menu-items menu-items--expanded');
|
|
123
|
-
await menuButton.click();
|
|
124
|
-
await expect(menuCategory.locator('.menu-items')).toHaveClass('menu-items menu-items--collapsed');
|
|
125
|
-
});
|
|
126
|
-
regressionTest('should hide menu-items when collapsed', async ({ mount, page }) => {
|
|
127
|
-
await mount(`
|
|
128
|
-
<ix-basic-navigation>
|
|
129
|
-
<ix-menu>
|
|
130
|
-
<ix-menu-category label="Category label">
|
|
131
|
-
<ix-menu-item>Test Item 1</ix-menu-item>
|
|
132
|
-
<ix-menu-item>Test Item 2</ix-menu-item>
|
|
133
|
-
</ix-menu-category>
|
|
134
|
-
</ix-menu>
|
|
135
|
-
</ix-basic-navigation>
|
|
136
|
-
`);
|
|
137
|
-
await page.waitForSelector('ix-menu');
|
|
138
|
-
const menu = page.locator('ix-menu');
|
|
139
|
-
await page
|
|
140
|
-
.locator('ix-basic-navigation')
|
|
141
|
-
.evaluate((menu) => (menu.breakpoints = ['md']));
|
|
142
|
-
const menuButton = menu.locator('ix-menu-expand-icon');
|
|
143
|
-
await menuButton.click();
|
|
144
|
-
const menuCategory = page.locator('ix-menu-category');
|
|
145
|
-
await expect(menuCategory.locator('.menu-items')).toHaveClass('menu-items menu-items--collapsed');
|
|
146
|
-
await expect(menuCategory.locator('.menu-items')).toBeHidden();
|
|
147
|
-
});
|
|
148
|
-
regressionTest('should open category when collapsed initially and active', async ({ mount, page }) => {
|
|
149
|
-
await mount(`
|
|
150
|
-
<ix-basic-navigation>
|
|
151
|
-
<ix-menu>
|
|
152
|
-
<ix-menu-category label="Category label">
|
|
153
|
-
<ix-menu-item active="true">Test Item 1</ix-menu-item>
|
|
154
|
-
<ix-menu-item>Test Item 2</ix-menu-item>
|
|
155
|
-
</ix-menu-category>
|
|
156
|
-
</ix-menu>
|
|
157
|
-
</ix-basic-navigation>
|
|
158
|
-
`);
|
|
159
|
-
await page.waitForSelector('ix-menu');
|
|
160
|
-
const menu = page.locator('ix-menu');
|
|
161
|
-
await page
|
|
162
|
-
.locator('ix-basic-navigation')
|
|
163
|
-
.evaluate((menu) => (menu.breakpoints = ['md']));
|
|
164
|
-
const menuButton = menu.locator('ix-menu-expand-icon');
|
|
165
|
-
await menuButton.click();
|
|
166
|
-
const menuCategory = page.locator('ix-menu-category');
|
|
167
|
-
await expect(menuCategory.locator('.menu-items')).toHaveClass('menu-items menu-items--expanded');
|
|
168
|
-
await menuCategory.locator('.category-parent').click();
|
|
169
|
-
await expect(menuCategory.locator('.menu-items')).toHaveClass(/menu-items/);
|
|
170
|
-
await menuButton.click();
|
|
171
|
-
await menuButton.click();
|
|
172
|
-
await expect(menuCategory.locator('.menu-items')).toHaveClass('menu-items menu-items--expanded');
|
|
173
|
-
});
|
|
174
|
-
regressionTest('do not show tooltip', async ({ mount, page }) => {
|
|
175
|
-
await mount(`
|
|
176
|
-
<ix-application>
|
|
177
|
-
<ix-menu>
|
|
178
|
-
<ix-menu-category label="Category label">
|
|
179
|
-
<ix-menu-item>Test</ix-menu-item>
|
|
180
|
-
<ix-menu-item>Test</ix-menu-item>
|
|
181
|
-
</ix-menu-category>
|
|
182
|
-
</ix-menu>
|
|
183
|
-
</ix-application>
|
|
184
|
-
`);
|
|
185
|
-
const categoryElement = page.locator('ix-menu-category');
|
|
186
|
-
await expect(categoryElement).toHaveClass(/hydrated/);
|
|
187
|
-
await categoryElement.hover();
|
|
188
|
-
await page.waitForTimeout(1500);
|
|
189
|
-
const tooltip = categoryElement
|
|
190
|
-
.locator('ix-menu-item.category-parent')
|
|
191
|
-
.locator('ix-tooltip');
|
|
192
|
-
await expect(tooltip).not.toBeVisible();
|
|
193
|
-
});
|
|
194
|
-
regressionTest('collapse after category blur', async ({ mount, page }) => {
|
|
195
|
-
await mount(`
|
|
196
|
-
<ix-application>
|
|
197
|
-
<ix-menu>
|
|
198
|
-
<ix-menu-item label="Other"></ix-menu-item>
|
|
199
|
-
<ix-menu-category label="Category label">
|
|
200
|
-
<ix-menu-item>Test</ix-menu-item>
|
|
201
|
-
<ix-menu-item>Test</ix-menu-item>
|
|
202
|
-
</ix-menu-category>
|
|
203
|
-
</ix-menu>
|
|
204
|
-
</ix-application>
|
|
205
|
-
`);
|
|
206
|
-
const menuItem = page.locator('ix-menu-item').filter({
|
|
207
|
-
hasText: 'Other',
|
|
208
|
-
});
|
|
209
|
-
const categoryElement = page.locator('ix-menu-category');
|
|
210
|
-
await expect(categoryElement).toHaveClass(/hydrated/);
|
|
211
|
-
await categoryElement.hover();
|
|
212
|
-
const dropdown = categoryElement.locator('ix-dropdown');
|
|
213
|
-
await expect(dropdown).toBeVisible();
|
|
214
|
-
await categoryElement.hover();
|
|
215
|
-
await menuItem.hover();
|
|
216
|
-
await expect(dropdown).not.toBeVisible();
|
|
217
|
-
});
|
|
218
|
-
regressionTest('show category if item are focused', async ({ mount, page }) => {
|
|
219
|
-
await mount(`
|
|
220
|
-
<ix-application>
|
|
221
|
-
<ix-menu>
|
|
222
|
-
<ix-menu-category label="Category label">
|
|
223
|
-
<ix-menu-item>Test</ix-menu-item>
|
|
224
|
-
<ix-menu-item>Test</ix-menu-item>
|
|
225
|
-
</ix-menu-category>
|
|
226
|
-
</ix-menu>
|
|
227
|
-
</ix-application>
|
|
228
|
-
`);
|
|
229
|
-
const categoryElement = page.locator('ix-menu-category');
|
|
230
|
-
await expect(categoryElement).toHaveClass(/hydrated/);
|
|
231
|
-
// Navigate to category
|
|
232
|
-
await page.keyboard.press('Tab');
|
|
233
|
-
await page.keyboard.press('Tab');
|
|
234
|
-
await page.keyboard.press('Tab');
|
|
235
|
-
const dropdown = categoryElement.locator('ix-dropdown');
|
|
236
|
-
await expect(dropdown).toBeVisible();
|
|
237
|
-
});
|
|
238
|
-
test('should adjust height when items are added dynamically', async ({ mount, page, }) => {
|
|
239
|
-
await mount(`
|
|
240
|
-
<ix-application>
|
|
241
|
-
<ix-menu>
|
|
242
|
-
<ix-menu-category label="Category label">
|
|
243
|
-
<ix-menu-item>Test</ix-menu-item>
|
|
244
|
-
<ix-menu-item>Test</ix-menu-item>
|
|
245
|
-
</ix-menu-category>
|
|
246
|
-
</ix-menu>
|
|
247
|
-
</ix-application>
|
|
248
|
-
`);
|
|
249
|
-
const menuCategory = page.locator('ix-menu-category');
|
|
250
|
-
await page.locator('ix-menu-expand-icon').click();
|
|
251
|
-
await menuCategory.click();
|
|
252
|
-
// wait for dropdown items to be visible
|
|
253
|
-
await page.waitForTimeout(300);
|
|
254
|
-
const initialHeight = await menuCategory
|
|
255
|
-
.boundingBox()
|
|
256
|
-
.then((box) => box === null || box === void 0 ? void 0 : box.height);
|
|
257
|
-
await page.evaluate(() => {
|
|
258
|
-
const menuCategory = document.querySelector('ix-menu-category');
|
|
259
|
-
const newMenuItem1 = document.createElement('ix-menu-item');
|
|
260
|
-
const newMenuItem2 = document.createElement('ix-menu-item');
|
|
261
|
-
newMenuItem1.textContent = 'Dynamically Added';
|
|
262
|
-
newMenuItem2.textContent = 'Dynamically Added';
|
|
263
|
-
menuCategory === null || menuCategory === void 0 ? void 0 : menuCategory.appendChild(newMenuItem1);
|
|
264
|
-
menuCategory === null || menuCategory === void 0 ? void 0 : menuCategory.appendChild(newMenuItem2);
|
|
265
|
-
});
|
|
266
|
-
// wait for new items to be visible
|
|
267
|
-
await page.waitForTimeout(300);
|
|
268
|
-
const newHeight = await menuCategory.boundingBox().then((box) => box === null || box === void 0 ? void 0 : box.height);
|
|
269
|
-
expect(initialHeight).toBeDefined();
|
|
270
|
-
expect(newHeight).toBeDefined();
|
|
271
|
-
expect(initialHeight).toBe(136);
|
|
272
|
-
expect(newHeight).toBe(216);
|
|
273
|
-
});
|
|
274
|
-
//# sourceMappingURL=menu-category.ct.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"menu-category.ct.js","sourceRoot":"","sources":["../../../../src/components/menu-category/test/menu-category.ct.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAEnD,cAAc,CAAC,SAAS,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE;IAClD,MAAM,KAAK,CAAC;;;;;;;;;KAST,CAAC,CAAC;IACL,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;IACjD,MAAM,MAAM,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;AAChD,CAAC,CAAC,CAAC;AAEH,cAAc,CAAC,0BAA0B,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE;IACnE,MAAM,KAAK,CAAC;;;;;;;;;GASX,CAAC,CAAC;IACH,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;IACtD,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,qBAAqB,CAAC,CAAC;IAChD,MAAM,gBAAgB,GAAG,IAAI;SAC1B,OAAO,CAAC,SAAS,CAAC;SAClB,OAAO,CAAC,qBAAqB,CAAC,CAAC;IAElC,MAAM,GAAG,CAAC,QAAQ,CAChB,CAAC,IAAkC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,WAAW,GAAG,CAAC,IAAI,CAA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,CAAC,CAAC;QACxC,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,WAAW,CAAC,YAAY,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;IAEH,mCAAmC;IACnC,MAAM,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;IAE/B,MAAM,SAAS,GAAG,MAAM,YAAY,CAAC,WAAW,EAAE,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,MAAM,CAAC,CAAC;IAE9E,MAAM,CAAC,aAAa,CAAC,CAAC,WAAW,EAAE,CAAC;IACpC,MAAM,CAAC,SAAS,CAAC,CAAC,WAAW,EAAE,CAAC;IAChC,MAAM,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAChC,MAAM,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC9B,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 { expect } from '@playwright/test';\nimport { regressionTest, test } from '@utils/test';\n\nregressionTest('renders', async ({ mount, page }) => {\n await mount(`\n <ix-application>\n <ix-menu>\n <ix-menu-category label=\"Category label\">\n <ix-menu-item>Test</ix-menu-item>\n <ix-menu-item>Test</ix-menu-item>\n </ix-menu-category>\n </ix-menu>\n </ix-application>\n `);\n const element = page.locator('ix-menu-category');\n await expect(element).toHaveClass('hydrated');\n});\n\nregressionTest('should collapse by click', async ({ mount, page }) => {\n await mount(`\n <ix-basic-navigation>\n <ix-menu>\n <ix-menu-category label=\"Category label\">\n <ix-menu-item>Test</ix-menu-item>\n <ix-menu-item>Test 2</ix-menu-item>\n </ix-menu-category>\n </ix-menu>\n </ix-basic-navigation>\n `);\n const categoryItem = page.locator('ix-menu-category');\n const app = page.locator('ix-basic-navigation');\n const expandMenuButton = page\n .locator('ix-menu')\n .locator('ix-menu-expand-icon');\n\n await app.evaluate(\n (menu: HTMLIxBasicNavigationElement) => (menu.breakpoints = ['md'])\n );\n\n await categoryItem.click();\n\n const item = page.locator('ix-menu-item').getByText('Test 2');\n await item.evaluate((item: HTMLIxMenuItemElement) => (item.active = true));\n await expect(item).toHaveClass(/active/);\n\n await item.click();\n await expandMenuButton.click();\n\n await expect(categoryItem.locator('.menu-items')).toHaveClass(\n /menu-items--expanded/\n );\n\n await categoryItem.locator('.category-parent').click();\n\n await expect(categoryItem.locator('.menu-items')).not.toHaveClass(\n /menu-items--expanded/\n );\n});\n\nregressionTest('should expand items', async ({ mount, page }) => {\n await mount(`\n <ix-basic-navigation>\n <ix-menu>\n <ix-menu-category label=\"Category label\">\n <ix-menu-item>Test Item 1</ix-menu-item>\n <ix-menu-item>Test Item 2</ix-menu-item>\n </ix-menu-category>\n </ix-menu>\n </ix-basic-navigation>\n `);\n\n const menu = page.locator('ix-menu');\n await page\n .locator('ix-basic-navigation')\n .evaluate(\n (menu: HTMLIxBasicNavigationElement) => (menu.breakpoints = ['md'])\n );\n\n const menuButton = menu.locator('ix-menu-expand-icon');\n await menuButton.click();\n const menuCategory = page.locator('ix-menu-category');\n await menuCategory.click();\n\n await expect(menuCategory.locator('.menu-items')).toHaveClass(\n 'menu-items menu-items--expanded'\n );\n const dropdown = menuCategory.locator('ix-dropdown');\n await expect(dropdown).not.toBeVisible();\n});\n\nregressionTest('should show items as dropdown', async ({ mount, page }) => {\n await mount(`\n <ix-basic-navigation>\n <ix-menu>\n <ix-menu-category label=\"Category label\">\n <ix-menu-item>Test Item 1</ix-menu-item>\n <ix-menu-item>Test Item 2</ix-menu-item>\n </ix-menu-category>\n </ix-menu>\n </ix-basic-navigation>\n `);\n\n await page.waitForSelector('ix-menu');\n await page\n .locator('ix-basic-navigation')\n .evaluate(\n (menu: HTMLIxBasicNavigationElement) => (menu.breakpoints = ['md'])\n );\n\n const menuCategory = page.locator('ix-menu-category');\n await menuCategory.hover();\n\n const dropdown = menuCategory.locator('ix-dropdown');\n await expect(dropdown).toBeVisible();\n await expect(menuCategory.locator('.menu-items')).toHaveClass(\n 'menu-items menu-items--collapsed'\n );\n\n const dropdownHeader = dropdown.locator('ix-dropdown-item');\n await expect(dropdownHeader).toHaveText('Category label');\n\n const itemOne = page.locator('ix-menu-item').nth(0);\n const itemTwo = page.locator('ix-menu-item').nth(1);\n\n await expect(itemOne).toBeVisible();\n await expect(itemTwo).toBeVisible();\n});\n\nregressionTest(\n 'should collapse category after collapse menu',\n async ({ mount, page }) => {\n await mount(`\n <ix-basic-navigation>\n <ix-menu>\n <ix-menu-category label=\"Category label\">\n <ix-menu-item>Test Item 1</ix-menu-item>\n <ix-menu-item>Test Item 2</ix-menu-item>\n </ix-menu-category>\n </ix-menu>\n </ix-basic-navigation>\n `);\n\n await page.waitForSelector('ix-menu');\n const menu = page.locator('ix-menu');\n await page\n .locator('ix-basic-navigation')\n .evaluate(\n (menu: HTMLIxBasicNavigationElement) => (menu.breakpoints = ['md'])\n );\n\n const menuButton = menu.locator('ix-menu-expand-icon');\n await menuButton.click();\n\n const menuCategory = page.locator('ix-menu-category');\n await menuCategory.click();\n\n await expect(menuCategory.locator('.menu-items')).toHaveClass(\n 'menu-items menu-items--expanded'\n );\n\n await menuButton.click();\n await expect(menuCategory.locator('.menu-items')).toHaveClass(\n 'menu-items menu-items--collapsed'\n );\n }\n);\n\nregressionTest(\n 'should hide menu-items when collapsed',\n async ({ mount, page }) => {\n await mount(`\n <ix-basic-navigation>\n <ix-menu>\n <ix-menu-category label=\"Category label\">\n <ix-menu-item>Test Item 1</ix-menu-item>\n <ix-menu-item>Test Item 2</ix-menu-item>\n </ix-menu-category>\n </ix-menu>\n </ix-basic-navigation>\n `);\n\n await page.waitForSelector('ix-menu');\n const menu = page.locator('ix-menu');\n await page\n .locator('ix-basic-navigation')\n .evaluate(\n (menu: HTMLIxBasicNavigationElement) => (menu.breakpoints = ['md'])\n );\n\n const menuButton = menu.locator('ix-menu-expand-icon');\n await menuButton.click();\n\n const menuCategory = page.locator('ix-menu-category');\n\n await expect(menuCategory.locator('.menu-items')).toHaveClass(\n 'menu-items menu-items--collapsed'\n );\n await expect(menuCategory.locator('.menu-items')).toBeHidden();\n }\n);\n\nregressionTest(\n 'should open category when collapsed initially and active',\n async ({ mount, page }) => {\n await mount(`\n <ix-basic-navigation>\n <ix-menu>\n <ix-menu-category label=\"Category label\">\n <ix-menu-item active=\"true\">Test Item 1</ix-menu-item>\n <ix-menu-item>Test Item 2</ix-menu-item>\n </ix-menu-category>\n </ix-menu>\n </ix-basic-navigation>\n `);\n\n await page.waitForSelector('ix-menu');\n const menu = page.locator('ix-menu');\n await page\n .locator('ix-basic-navigation')\n .evaluate(\n (menu: HTMLIxBasicNavigationElement) => (menu.breakpoints = ['md'])\n );\n\n const menuButton = menu.locator('ix-menu-expand-icon');\n await menuButton.click();\n\n const menuCategory = page.locator('ix-menu-category');\n await expect(menuCategory.locator('.menu-items')).toHaveClass(\n 'menu-items menu-items--expanded'\n );\n\n await menuCategory.locator('.category-parent').click();\n await expect(menuCategory.locator('.menu-items')).toHaveClass(/menu-items/);\n await menuButton.click();\n await menuButton.click();\n\n await expect(menuCategory.locator('.menu-items')).toHaveClass(\n 'menu-items menu-items--expanded'\n );\n }\n);\n\nregressionTest('do not show tooltip', async ({ mount, page }) => {\n await mount(`\n <ix-application>\n <ix-menu>\n <ix-menu-category label=\"Category label\">\n <ix-menu-item>Test</ix-menu-item>\n <ix-menu-item>Test</ix-menu-item>\n </ix-menu-category>\n </ix-menu>\n </ix-application>\n `);\n const categoryElement = page.locator('ix-menu-category');\n await expect(categoryElement).toHaveClass(/hydrated/);\n\n await categoryElement.hover();\n await page.waitForTimeout(1500);\n\n const tooltip = categoryElement\n .locator('ix-menu-item.category-parent')\n .locator('ix-tooltip');\n\n await expect(tooltip).not.toBeVisible();\n});\n\nregressionTest('collapse after category blur', async ({ mount, page }) => {\n await mount(`\n <ix-application>\n <ix-menu>\n <ix-menu-item label=\"Other\"></ix-menu-item>\n <ix-menu-category label=\"Category label\">\n <ix-menu-item>Test</ix-menu-item>\n <ix-menu-item>Test</ix-menu-item>\n </ix-menu-category>\n </ix-menu>\n </ix-application>\n `);\n const menuItem = page.locator('ix-menu-item').filter({\n hasText: 'Other',\n });\n const categoryElement = page.locator('ix-menu-category');\n await expect(categoryElement).toHaveClass(/hydrated/);\n\n await categoryElement.hover();\n\n const dropdown = categoryElement.locator('ix-dropdown');\n await expect(dropdown).toBeVisible();\n\n await categoryElement.hover();\n await menuItem.hover();\n\n await expect(dropdown).not.toBeVisible();\n});\n\nregressionTest('show category if item are focused', async ({ mount, page }) => {\n await mount(`\n <ix-application>\n <ix-menu>\n <ix-menu-category label=\"Category label\">\n <ix-menu-item>Test</ix-menu-item>\n <ix-menu-item>Test</ix-menu-item>\n </ix-menu-category>\n </ix-menu>\n </ix-application>\n `);\n const categoryElement = page.locator('ix-menu-category');\n await expect(categoryElement).toHaveClass(/hydrated/);\n\n // Navigate to category\n await page.keyboard.press('Tab');\n await page.keyboard.press('Tab');\n await page.keyboard.press('Tab');\n\n const dropdown = categoryElement.locator('ix-dropdown');\n await expect(dropdown).toBeVisible();\n});\n\ntest('should adjust height when items are added dynamically', async ({\n mount,\n page,\n}) => {\n await mount(`\n <ix-application>\n <ix-menu>\n <ix-menu-category label=\"Category label\">\n <ix-menu-item>Test</ix-menu-item>\n <ix-menu-item>Test</ix-menu-item>\n </ix-menu-category>\n </ix-menu>\n </ix-application>\n `);\n\n const menuCategory = page.locator('ix-menu-category');\n\n await page.locator('ix-menu-expand-icon').click();\n await menuCategory.click();\n\n // wait for dropdown items to be visible\n await page.waitForTimeout(300);\n\n const initialHeight = await menuCategory\n .boundingBox()\n .then((box) => box?.height);\n\n await page.evaluate(() => {\n const menuCategory = document.querySelector('ix-menu-category');\n\n const newMenuItem1 = document.createElement('ix-menu-item');\n const newMenuItem2 = document.createElement('ix-menu-item');\n\n newMenuItem1.textContent = 'Dynamically Added';\n newMenuItem2.textContent = 'Dynamically Added';\n\n menuCategory?.appendChild(newMenuItem1);\n menuCategory?.appendChild(newMenuItem2);\n });\n\n // wait for new items to be visible\n await page.waitForTimeout(300);\n\n const newHeight = await menuCategory.boundingBox().then((box) => box?.height);\n\n expect(initialHeight).toBeDefined();\n expect(newHeight).toBeDefined();\n expect(initialHeight).toBe(136);\n expect(newHeight).toBe(216);\n});\n"]}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* SPDX-FileCopyrightText: 2025 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(`
|
|
13
|
-
<ix-application>
|
|
14
|
-
<ix-menu>
|
|
15
|
-
<ix-menu-item>Foo bar</ix-menu-item>
|
|
16
|
-
<ix-menu-item>Hello World</ix-menu-item>
|
|
17
|
-
</ix-menu>
|
|
18
|
-
</ix-application>
|
|
19
|
-
`);
|
|
20
|
-
const menuItem1 = page.locator('ix-menu-item').nth(0);
|
|
21
|
-
const menuItem2 = page.locator('ix-menu-item').nth(1);
|
|
22
|
-
await expect(menuItem1).toHaveClass('hydrated');
|
|
23
|
-
await expect(menuItem2).toHaveClass('hydrated');
|
|
24
|
-
await expect(menuItem1.locator('.tab-text').locator('slot')).toBeAttached();
|
|
25
|
-
});
|
|
26
|
-
regressionTest('show tooltip', async ({ mount, page }) => {
|
|
27
|
-
await mount(`
|
|
28
|
-
<ix-application>
|
|
29
|
-
<ix-menu>
|
|
30
|
-
<ix-menu-item>Foo bar</ix-menu-item>
|
|
31
|
-
<ix-menu-item>Hello World</ix-menu-item>
|
|
32
|
-
</ix-menu>
|
|
33
|
-
</ix-application>
|
|
34
|
-
`);
|
|
35
|
-
const menuItem1 = page.locator('ix-menu-item').nth(0);
|
|
36
|
-
const menuItem2 = page.locator('ix-menu-item').nth(1);
|
|
37
|
-
await expect(menuItem1).toHaveClass('hydrated');
|
|
38
|
-
await expect(menuItem2).toHaveClass('hydrated');
|
|
39
|
-
await menuItem1.hover();
|
|
40
|
-
// Default tooltip delay is 1000ms waiting another 500 ms
|
|
41
|
-
await page.waitForTimeout(1500);
|
|
42
|
-
await expect(menuItem1.locator('ix-tooltip')).toHaveClass(/visible/);
|
|
43
|
-
await expect(menuItem1.locator('ix-tooltip')).toHaveText('Foo bar');
|
|
44
|
-
});
|
|
45
|
-
regressionTest('update item text', async ({ mount, page }) => {
|
|
46
|
-
await mount(`
|
|
47
|
-
<ix-application>
|
|
48
|
-
<ix-menu>
|
|
49
|
-
<ix-menu-item>Foo bar</ix-menu-item>
|
|
50
|
-
<ix-menu-item>Hello World</ix-menu-item>
|
|
51
|
-
</ix-menu>
|
|
52
|
-
</ix-application>
|
|
53
|
-
`);
|
|
54
|
-
const menuItem1 = page.locator('ix-menu-item').nth(0);
|
|
55
|
-
const menuItem2 = page.locator('ix-menu-item').nth(1);
|
|
56
|
-
await expect(menuItem1).toHaveClass('hydrated');
|
|
57
|
-
await expect(menuItem2).toHaveClass('hydrated');
|
|
58
|
-
await expect(menuItem1.locator('.tab-text').locator('slot')).toBeAttached();
|
|
59
|
-
await expect(menuItem1.locator('ix-tooltip')).toHaveText('Foo bar');
|
|
60
|
-
await menuItem1.evaluate((item) => (item.innerText = 'Test123'));
|
|
61
|
-
await menuItem1.hover();
|
|
62
|
-
// Default tooltip delay is 1000ms waiting another 500 ms
|
|
63
|
-
await page.waitForTimeout(1500);
|
|
64
|
-
await expect(menuItem1.locator('ix-tooltip')).toHaveClass(/visible/);
|
|
65
|
-
await expect(menuItem1.locator('ix-tooltip')).toHaveText('Test123');
|
|
66
|
-
});
|
|
67
|
-
//# sourceMappingURL=menu-item.ct.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"menu-item.ct.js","sourceRoot":"","sources":["../../../../src/components/menu-item/test/menu-item.ct.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,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;;;;;;;KAOT,CAAC,CAAC;IACL,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACtD,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACtD,MAAM,MAAM,CAAC,SAAS,CAAC,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IAChD,MAAM,MAAM,CAAC,SAAS,CAAC,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IAEhD,MAAM,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,YAAY,EAAE,CAAC;AAC9E,CAAC,CAAC,CAAC;AAEH,cAAc,CAAC,cAAc,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE;IACvD,MAAM,KAAK,CAAC;;;;;;;KAOT,CAAC,CAAC;IACL,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACtD,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,GAAG,CAAC,CAAC,C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,CAAC,IAA2B,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC,CAC9D,CAAC;IAEF,MAAM,SAAS,CAAC,KAAK,EAAE,CAAC;IACxB,yDAAyD;IACzD,MAAM,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;IAEhC,MAAM,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;IACrE,MAAM,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;AACtE,CAAC,CAAC,CAAC","sourcesContent":["/*\n * SPDX-FileCopyrightText: 2025 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 */\n\nimport { expect } from '@playwright/test';\nimport { regressionTest } from '@utils/test';\n\nregressionTest('renders', async ({ mount, page }) => {\n await mount(`\n <ix-application>\n <ix-menu>\n <ix-menu-item>Foo bar</ix-menu-item>\n <ix-menu-item>Hello World</ix-menu-item>\n </ix-menu>\n </ix-application>\n `);\n const menuItem1 = page.locator('ix-menu-item').nth(0);\n const menuItem2 = page.locator('ix-menu-item').nth(1);\n await expect(menuItem1).toHaveClass('hydrated');\n await expect(menuItem2).toHaveClass('hydrated');\n\n await expect(menuItem1.locator('.tab-text').locator('slot')).toBeAttached();\n});\n\nregressionTest('show tooltip', async ({ mount, page }) => {\n await mount(`\n <ix-application>\n <ix-menu>\n <ix-menu-item>Foo bar</ix-menu-item>\n <ix-menu-item>Hello World</ix-menu-item>\n </ix-menu>\n </ix-application>\n `);\n const menuItem1 = page.locator('ix-menu-item').nth(0);\n const menuItem2 = page.locator('ix-menu-item').nth(1);\n await expect(menuItem1).toHaveClass('hydrated');\n await expect(menuItem2).toHaveClass('hydrated');\n\n await menuItem1.hover();\n // Default tooltip delay is 1000ms waiting another 500 ms\n await page.waitForTimeout(1500);\n\n await expect(menuItem1.locator('ix-tooltip')).toHaveClass(/visible/);\n await expect(menuItem1.locator('ix-tooltip')).toHaveText('Foo bar');\n});\n\nregressionTest('update item text', async ({ mount, page }) => {\n await mount(`\n <ix-application>\n <ix-menu>\n <ix-menu-item>Foo bar</ix-menu-item>\n <ix-menu-item>Hello World</ix-menu-item>\n </ix-menu>\n </ix-application>\n `);\n const menuItem1 = page.locator('ix-menu-item').nth(0);\n const menuItem2 = page.locator('ix-menu-item').nth(1);\n await expect(menuItem1).toHaveClass('hydrated');\n await expect(menuItem2).toHaveClass('hydrated');\n\n await expect(menuItem1.locator('.tab-text').locator('slot')).toBeAttached();\n await expect(menuItem1.locator('ix-tooltip')).toHaveText('Foo bar');\n\n await menuItem1.evaluate(\n (item: HTMLIxMenuItemElement) => (item.innerText = 'Test123')\n );\n\n await menuItem1.hover();\n // Default tooltip delay is 1000ms waiting another 500 ms\n await page.waitForTimeout(1500);\n\n await expect(menuItem1.locator('ix-tooltip')).toHaveClass(/visible/);\n await expect(menuItem1.locator('ix-tooltip')).toHaveText('Test123');\n});\n"]}
|
|
@@ -1,32 +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 { test } from "../../../tests/utils/test/index";
|
|
11
|
-
test('should not change tab', async ({ mount, page }) => {
|
|
12
|
-
await mount(`
|
|
13
|
-
<ix-menu>
|
|
14
|
-
<ix-menu-settings>
|
|
15
|
-
<ix-menu-settings-item label="Tab 1">Content 1</ix-menu-settings-item>
|
|
16
|
-
<ix-menu-settings-item label="Tab 2">Content 2</ix-menu-settings-item>
|
|
17
|
-
</ix-menu-settings>
|
|
18
|
-
</ix-menu>
|
|
19
|
-
`);
|
|
20
|
-
const settings = page.locator('ix-menu-settings');
|
|
21
|
-
const element = page.locator('ix-menu-item#settings');
|
|
22
|
-
await element.click();
|
|
23
|
-
const tabItems = page.locator('ix-tab-item');
|
|
24
|
-
await expect(tabItems.first()).toHaveClass(/hydrated/);
|
|
25
|
-
await settings.evaluate((e) => {
|
|
26
|
-
e.addEventListener('tabChange', (event) => event.preventDefault());
|
|
27
|
-
});
|
|
28
|
-
await tabItems.last().click();
|
|
29
|
-
await expect(tabItems.first()).toHaveAttribute('selected', 'true');
|
|
30
|
-
await expect(tabItems.last()).not.toHaveAttribute('selected', 'true');
|
|
31
|
-
});
|
|
32
|
-
//# sourceMappingURL=menu-settings.ct.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"menu-settings.ct.js","sourceRoot":"","sources":["../../../../src/components/menu-settings/test/menu-settings.ct.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAEnC,IAAI,CAAC,uBAAuB,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE;IACtD,MAAM,KAAK,CAAC;;;;;;;KAOT,CAAC,CAAC;IAEL,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAClD,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,uBAAuB,CAAC,CAAC;IACtD,MAAM,OAAO,CAAC,KAAK,EAAE,CAAC;IAEtB,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;IAC7C,MAAM,MAAM,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IAEvD,MAAM,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,EAAE;QAC5B,CAAC,CAAC,gBAAgB,CAAC,WAAW,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,cAAc,EAAE,CAAC,CAAC;IACrE,CAAC,CAAC,CAAC;IAEH,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC,KAAK,EAAE,CAAC;IAE9B,MAAM,MAAM,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC,eAAe,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;IACnE,MAAM,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,eAAe,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;AACxE,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 { test } from '@utils/test';\n\ntest('should not change tab', async ({ mount, page }) => {\n await mount(`\n <ix-menu>\n <ix-menu-settings>\n <ix-menu-settings-item label=\"Tab 1\">Content 1</ix-menu-settings-item>\n <ix-menu-settings-item label=\"Tab 2\">Content 2</ix-menu-settings-item>\n </ix-menu-settings>\n </ix-menu>\n `);\n\n const settings = page.locator('ix-menu-settings');\n const element = page.locator('ix-menu-item#settings');\n await element.click();\n\n const tabItems = page.locator('ix-tab-item');\n await expect(tabItems.first()).toHaveClass(/hydrated/);\n\n await settings.evaluate((e) => {\n e.addEventListener('tabChange', (event) => event.preventDefault());\n });\n\n await tabItems.last().click();\n\n await expect(tabItems.first()).toHaveAttribute('selected', 'true');\n await expect(tabItems.last()).not.toHaveAttribute('selected', 'true');\n});\n"]}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* SPDX-FileCopyrightText: 2025 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 { test } from "../../../tests/utils/test/index";
|
|
11
|
-
test.describe('ix-message-bar', () => {
|
|
12
|
-
test.beforeEach(async ({ mount }) => {
|
|
13
|
-
await mount(`<ix-message-bar type="danger" dismissible>Content</ix-message-bar>`);
|
|
14
|
-
});
|
|
15
|
-
test('emits closeAnimationCompleted event', async ({ page }) => {
|
|
16
|
-
const messageBar = page.locator('ix-message-bar');
|
|
17
|
-
const closeButton = messageBar.locator('[data-testid="close-btn"]');
|
|
18
|
-
const onCloseAnimationCompleted = messageBar.evaluate((element) => {
|
|
19
|
-
return new Promise((resolve) => {
|
|
20
|
-
element.addEventListener('closeAnimationCompleted', () => resolve());
|
|
21
|
-
});
|
|
22
|
-
});
|
|
23
|
-
await closeButton.click();
|
|
24
|
-
await onCloseAnimationCompleted;
|
|
25
|
-
await expect(messageBar).not.toBeVisible();
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
|
-
//# sourceMappingURL=message-bar.ct.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"message-bar.ct.js","sourceRoot":"","sources":["../../../../src/components/message-bar/test/message-bar.ct.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAEnC,IAAI,CAAC,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IACnC,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE;QAClC,MAAM,KAAK,CACT,oEAAoE,CACrE,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,qCAAqC,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;QAC7D,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC;QAClD,MAAM,WAAW,GAAG,UAAU,CAAC,OAAO,CAAC,2BAA2B,CAAC,CAAC;QAEpE,MAAM,yBAAyB,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC,OAAO,EAAE,EAAE;YAChE,OAAO,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE;gBACnC,OAAO,CAAC,gBAAgB,CAAC,yBAAyB,EAAE,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC;YACvE,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QACH,MAAM,WAAW,CAAC,KAAK,EAAE,CAAC;QAC1B,MAAM,yBAAyB,CAAC;QAEhC,MAAM,MAAM,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC;IAC7C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["/*\n * SPDX-FileCopyrightText: 2025 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 */\n\nimport { expect } from '@playwright/test';\nimport { test } from '@utils/test';\n\ntest.describe('ix-message-bar', () => {\n test.beforeEach(async ({ mount }) => {\n await mount(\n `<ix-message-bar type=\"danger\" dismissible>Content</ix-message-bar>`\n );\n });\n\n test('emits closeAnimationCompleted event', async ({ page }) => {\n const messageBar = page.locator('ix-message-bar');\n const closeButton = messageBar.locator('[data-testid=\"close-btn\"]');\n\n const onCloseAnimationCompleted = messageBar.evaluate((element) => {\n return new Promise<void>((resolve) => {\n element.addEventListener('closeAnimationCompleted', () => resolve());\n });\n });\n await closeButton.click();\n await onCloseAnimationCompleted;\n\n await expect(messageBar).not.toBeVisible();\n });\n});\n"]}
|