Skip to content

Commit 7ac215b

Browse files
authored
test(item): migrate tests to playwright (#25479)
1 parent b62dded commit 7ac215b

File tree

334 files changed

+420
-474
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

334 files changed

+420
-474
lines changed

core/src/components/item/test/a11y/e2e.ts

Lines changed: 0 additions & 14 deletions
This file was deleted.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import AxeBuilder from '@axe-core/playwright';
2+
import { expect } from '@playwright/test';
3+
import { test } from '@utils/test/playwright';
4+
5+
test.describe('item: axe', () => {
6+
test('should not have accessibility violations', async ({ page }) => {
7+
await page.goto(`/src/components/item/test/a11y`);
8+
9+
const results = await new AxeBuilder({ page })
10+
// TODO(FW-404): Re-enable rule once select is updated to avoid nested-interactive
11+
.disableRules('nested-interactive')
12+
.analyze();
13+
expect(results.violations).toEqual([]);
14+
});
15+
});

core/src/components/item/test/alignment/e2e.ts

Lines changed: 0 additions & 19 deletions
This file was deleted.

core/src/components/item/test/alignment/index.html

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,6 @@
2525
<ion-content>
2626
<ion-list>
2727
<ion-list-header>Leading Icons</ion-list-header>
28-
<ion-item>
29-
<ion-icon slot="start" name="time"></ion-icon>
30-
<ion-datetime display-format="DDDD MMMM D YYYY hh:mm:ss a" value="2019-10-01T15:43:40.394Z"></ion-datetime>
31-
</ion-item>
3228
<ion-item>
3329
<ion-icon slot="start" name="radio-button-off"></ion-icon>
3430
<ion-input placeholder="Choose Starting Point"></ion-input>
@@ -44,10 +40,6 @@
4440

4541
<ion-list>
4642
<ion-list-header>Default Labels</ion-list-header>
47-
<ion-item>
48-
<ion-label>Time</ion-label>
49-
<ion-datetime display-format="DDDD MMMM D YYYY hh:mm:ss a" value="2019-10-01T15:43:40.394Z"></ion-datetime>
50-
</ion-item>
5143
<ion-item>
5244
<ion-label>From</ion-label>
5345
<ion-input placeholder="Choose Starting Point"></ion-input>
@@ -63,10 +55,6 @@
6355

6456
<ion-list>
6557
<ion-list-header>Fixed Labels</ion-list-header>
66-
<ion-item>
67-
<ion-label position="fixed">Time</ion-label>
68-
<ion-datetime display-format="DDDD MMMM D YYYY hh:mm:ss a" value="2019-10-01T15:43:40.394Z"></ion-datetime>
69-
</ion-item>
7058
<ion-item>
7159
<ion-label position="fixed">From</ion-label>
7260
<ion-input placeholder="Choose Starting Point"></ion-input>
@@ -82,10 +70,6 @@
8270

8371
<ion-list>
8472
<ion-list-header>Floating Labels</ion-list-header>
85-
<ion-item>
86-
<ion-label position="floating">Time</ion-label>
87-
<ion-datetime display-format="DDDD MMMM D YYYY hh:mm:ss a"></ion-datetime>
88-
</ion-item>
8973
<ion-item>
9074
<ion-label position="floating">From</ion-label>
9175
<ion-input></ion-input>
@@ -101,10 +85,6 @@
10185

10286
<ion-list>
10387
<ion-list-header>Stacked Labels</ion-list-header>
104-
<ion-item>
105-
<ion-label position="stacked">Time</ion-label>
106-
<ion-datetime display-format="DDDD MMMM D YYYY hh:mm:ss a" value="2019-10-01T15:43:40.394Z"></ion-datetime>
107-
</ion-item>
10888
<ion-item>
10989
<ion-label position="stacked">From</ion-label>
11090
<ion-input placeholder="Choose Starting Point"></ion-input>
@@ -120,10 +100,6 @@
120100

121101
<ion-list>
122102
<ion-list-header>End Labels</ion-list-header>
123-
<ion-item>
124-
<ion-label slot="end">Time</ion-label>
125-
<ion-datetime display-format="DDDD MMMM D YYYY hh:mm:ss a" value="2019-10-01T15:43:40.394Z"></ion-datetime>
126-
</ion-item>
127103
<ion-item>
128104
<ion-label slot="end">From</ion-label>
129105
<ion-input placeholder="Choose Starting Point"></ion-input>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { expect } from '@playwright/test';
2+
import { test } from '@utils/test/playwright';
3+
4+
test.describe('item: alignment', () => {
5+
test('should not have visual regressions', async ({ page }) => {
6+
await page.goto(`/src/components/item/test/alignment`);
7+
8+
await page.setIonViewport();
9+
10+
expect(await page.screenshot()).toMatchSnapshot(`item-alignment-diff-${page.getSnapshotSettings()}.png`);
11+
});
12+
});
208 KB
65.2 KB
182 KB
201 KB
64.6 KB

0 commit comments

Comments
 (0)