Skip to content

Commit 3aabc61

Browse files
committed
update testing for bottom-content
1 parent 20a40ca commit 3aabc61

File tree

3 files changed

+43
-242
lines changed

3 files changed

+43
-242
lines changed

core/api.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1619,8 +1619,10 @@ ion-select,prop,cancelText,string,'Cancel',false,false
16191619
ion-select,prop,color,"danger" | "dark" | "light" | "medium" | "primary" | "secondary" | "success" | "tertiary" | "warning" | string & Record<never, never> | undefined,undefined,false,true
16201620
ion-select,prop,compareWith,((currentValue: any, compareValue: any) => boolean) | null | string | undefined,undefined,false,false
16211621
ion-select,prop,disabled,boolean,false,false,false
1622+
ion-select,prop,errorText,string | undefined,undefined,false,false
16221623
ion-select,prop,expandedIcon,string | undefined,undefined,false,false
16231624
ion-select,prop,fill,"outline" | "solid" | undefined,undefined,false,false
1625+
ion-select,prop,helperText,string | undefined,undefined,false,false
16241626
ion-select,prop,interface,"action-sheet" | "alert" | "modal" | "popover",'alert',false,false
16251627
ion-select,prop,interfaceOptions,any,{},false,false
16261628
ion-select,prop,justify,"end" | "space-between" | "start" | undefined,undefined,false,false

core/src/components/select/test/bottom-content/input.e2e.ts

Lines changed: 0 additions & 242 deletions
This file was deleted.
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import { expect } from '@playwright/test';
2+
import { configs, test } from '@utils/test/playwright';
3+
4+
configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
5+
test.describe(title('Select: Helper and Error Text'), () => {
6+
test.describe('Select with helper text', () => {
7+
test('should set label and show helper text', async ({ page }) => {
8+
await page.setContent(
9+
`
10+
<ion-select class="ion-touched ion-valid" helper-text="Select a fruit" value="apple">
11+
<div slot="label">Favorite Fruit</div>
12+
<ion-select-option value="apple">Apple</ion-select-option>
13+
<ion-select-option value="bananna">Bananna</ion-select-option>
14+
</ion-select>
15+
`,
16+
config
17+
);
18+
19+
const select = page.locator('ion-select');
20+
await expect(select).toHaveScreenshot(screenshot(`select-helper-text`));
21+
});
22+
});
23+
test.describe('Select with Error text', () => {
24+
test('should set label and show error text', async ({ page }) => {
25+
await page.setContent(
26+
`
27+
<ion-select class="ion-touched ion-invalid" error-text="No fruit selected">
28+
<div slot="label">Favorite Fruit</div>
29+
<ion-select-option value="apple">Apple</ion-select-option>
30+
<ion-select-option value="bananna">Bananna</ion-select-option>
31+
</ion-select>
32+
`,
33+
config
34+
);
35+
36+
const select = page.locator('ion-select');
37+
await expect(select).toHaveScreenshot(screenshot(`select-error-text`));
38+
});
39+
});
40+
});
41+
});

0 commit comments

Comments
 (0)