Skip to content

Commit 5e0ac20

Browse files
committed
test(select): add fill snapshots
1 parent 8c6fd79 commit 5e0ac20

13 files changed

+50
-42
lines changed

core/src/components/select/test/fill/select.e2e.ts

Lines changed: 50 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import { expect } from '@playwright/test';
22
import { configs, test } from '@utils/test/playwright';
33

4-
configs({ modes: ['md'] }).forEach(({ title, screenshot, config }) => {
4+
configs({ modes: ['md', 'ionic-md'] }).forEach(({ title, screenshot, config }) => {
55
test.describe(title('select: fill'), () => {
6-
test.describe('select: fill solid', () => {
6+
test.describe('select: fill outline', () => {
77
test('should not have visual regressions', async ({ page }) => {
88
await page.setContent(
99
`
1010
<ion-select
11-
fill="solid"
11+
fill="outline"
1212
label="Fruit"
1313
value="apple"
1414
>
@@ -19,13 +19,21 @@ configs({ modes: ['md'] }).forEach(({ title, screenshot, config }) => {
1919
);
2020

2121
const select = page.locator('ion-select');
22-
await expect(select).toHaveScreenshot(screenshot(`select-fill-solid`));
22+
await expect(select).toHaveScreenshot(screenshot(`select-fill-outline`));
2323
});
24-
test('should render correctly with floating label', async ({ page }) => {
24+
test('padding and border radius should be customizable', async ({ page }) => {
2525
await page.setContent(
2626
`
27+
<style>
28+
ion-select {
29+
--border-radius: 10px !important;
30+
--padding-start: 50px !important;
31+
--padding-end: 50px !important;
32+
}
33+
</style>
2734
<ion-select
28-
fill="solid"
35+
shape="round"
36+
fill="outline"
2937
label="Fruit"
3038
label-placement="floating"
3139
value="apple"
@@ -37,13 +45,20 @@ configs({ modes: ['md'] }).forEach(({ title, screenshot, config }) => {
3745
);
3846

3947
const select = page.locator('ion-select');
40-
await expect(select).toHaveScreenshot(screenshot(`select-fill-solid-label-floating`));
48+
await expect(select).toHaveScreenshot(screenshot(`select-fill-shaped-outline-custom`));
4149
});
42-
test('should not have visual regressions with shaped solid', async ({ page }) => {
50+
});
51+
});
52+
});
53+
54+
55+
configs({ modes: ['md'] }).forEach(({ title, screenshot, config }) => {
56+
test.describe(title('select: fill'), () => {
57+
test.describe('select: fill solid', () => {
58+
test('should not have visual regressions', async ({ page }) => {
4359
await page.setContent(
4460
`
4561
<ion-select
46-
shape="round"
4762
fill="solid"
4863
label="Fruit"
4964
value="apple"
@@ -55,20 +70,12 @@ configs({ modes: ['md'] }).forEach(({ title, screenshot, config }) => {
5570
);
5671

5772
const select = page.locator('ion-select');
58-
await expect(select).toHaveScreenshot(screenshot(`select-fill-shaped-solid`));
73+
await expect(select).toHaveScreenshot(screenshot(`select-fill-solid`));
5974
});
60-
test('padding and border radius should be customizable', async ({ page }) => {
75+
test('should render correctly with floating label', async ({ page }) => {
6176
await page.setContent(
6277
`
63-
<style>
64-
ion-select {
65-
--border-radius: 10px !important;
66-
--padding-start: 50px !important;
67-
--padding-end: 50px !important;
68-
}
69-
</style>
7078
<ion-select
71-
shape="round"
7279
fill="solid"
7380
label="Fruit"
7481
label-placement="floating"
@@ -81,15 +88,14 @@ configs({ modes: ['md'] }).forEach(({ title, screenshot, config }) => {
8188
);
8289

8390
const select = page.locator('ion-select');
84-
await expect(select).toHaveScreenshot(screenshot(`select-fill-shaped-solid-custom`));
91+
await expect(select).toHaveScreenshot(screenshot(`select-fill-solid-label-floating`));
8592
});
86-
});
87-
test.describe('select: fill outline', () => {
88-
test('should not have visual regressions', async ({ page }) => {
93+
test('should not have visual regressions with shaped solid', async ({ page }) => {
8994
await page.setContent(
9095
`
9196
<ion-select
92-
fill="outline"
97+
shape="round"
98+
fill="solid"
9399
label="Fruit"
94100
value="apple"
95101
>
@@ -100,13 +106,21 @@ configs({ modes: ['md'] }).forEach(({ title, screenshot, config }) => {
100106
);
101107

102108
const select = page.locator('ion-select');
103-
await expect(select).toHaveScreenshot(screenshot(`select-fill-outline`));
109+
await expect(select).toHaveScreenshot(screenshot(`select-fill-shaped-solid`));
104110
});
105-
test('should render correctly with floating label', async ({ page }) => {
111+
test('padding and border radius should be customizable', async ({ page }) => {
106112
await page.setContent(
107113
`
114+
<style>
115+
ion-select {
116+
--border-radius: 10px !important;
117+
--padding-start: 50px !important;
118+
--padding-end: 50px !important;
119+
}
120+
</style>
108121
<ion-select
109-
fill="outline"
122+
shape="round"
123+
fill="solid"
110124
label="Fruit"
111125
label-placement="floating"
112126
value="apple"
@@ -118,16 +132,17 @@ configs({ modes: ['md'] }).forEach(({ title, screenshot, config }) => {
118132
);
119133

120134
const select = page.locator('ion-select');
121-
await expect(select).toHaveScreenshot(screenshot(`select-fill-outline-label-floating`));
135+
await expect(select).toHaveScreenshot(screenshot(`select-fill-shaped-solid-custom`));
122136
});
123-
124-
test('should not have visual regressions with shaped outline', async ({ page }) => {
137+
});
138+
test.describe('select: fill outline', () => {
139+
test('should render correctly with floating label', async ({ page }) => {
125140
await page.setContent(
126141
`
127142
<ion-select
128-
shape="round"
129143
fill="outline"
130144
label="Fruit"
145+
label-placement="floating"
131146
value="apple"
132147
>
133148
<ion-select-option value="apple">Apple</ion-select-option>
@@ -137,23 +152,16 @@ configs({ modes: ['md'] }).forEach(({ title, screenshot, config }) => {
137152
);
138153

139154
const select = page.locator('ion-select');
140-
await expect(select).toHaveScreenshot(screenshot(`select-fill-shaped-outline`));
155+
await expect(select).toHaveScreenshot(screenshot(`select-fill-outline-label-floating`));
141156
});
142-
test('padding and border radius should be customizable', async ({ page }) => {
157+
158+
test('should not have visual regressions with shaped outline', async ({ page }) => {
143159
await page.setContent(
144160
`
145-
<style>
146-
ion-select {
147-
--border-radius: 10px !important;
148-
--padding-start: 50px !important;
149-
--padding-end: 50px !important;
150-
}
151-
</style>
152161
<ion-select
153162
shape="round"
154163
fill="outline"
155164
label="Fruit"
156-
label-placement="floating"
157165
value="apple"
158166
>
159167
<ion-select-option value="apple">Apple</ion-select-option>
@@ -163,7 +171,7 @@ configs({ modes: ['md'] }).forEach(({ title, screenshot, config }) => {
163171
);
164172

165173
const select = page.locator('ion-select');
166-
await expect(select).toHaveScreenshot(screenshot(`select-fill-shaped-outline-custom`));
174+
await expect(select).toHaveScreenshot(screenshot(`select-fill-shaped-outline`));
167175
});
168176
});
169177
});
2.16 KB
Loading
2.79 KB
Loading
2.25 KB
Loading
2.21 KB
Loading
2.86 KB
Loading
2.25 KB
Loading
Loading
Loading
Loading

0 commit comments

Comments
 (0)