Skip to content

Commit 3ff9faf

Browse files
fix(select): pass click event to popover interface (#17146)
also updates e2e test so that it will continue to take screenshots after mismatches and adds the popover example to avoid future regressions references #16715 fixes #17142
1 parent ceae5d2 commit 3ff9faf

File tree

3 files changed

+52
-12
lines changed

3 files changed

+52
-12
lines changed

core/src/components/select/select.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,8 @@ export class Select implements ComponentInterface {
139139
}
140140

141141
@Listen('click')
142-
onClick() {
143-
this.open();
142+
onClick(ev: UIEvent) {
143+
this.open(ev);
144144
}
145145

146146
async componentDidLoad() {

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

Lines changed: 49 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,68 @@ test('select: basic', async () => {
55
url: '/src/components/select/test/basic?ionic:_testing=true'
66
});
77

8-
let compare = await page.compareScreenshot();
9-
expect(compare).toMatchScreenshot();
8+
const compares = [];
9+
compares.push(await page.compareScreenshot());
1010

11+
// Gender Alert Select
1112
let select = await page.find('#gender');
1213
await select.click();
1314

14-
const alert = await page.find('ion-alert');
15+
let alert = await page.find('ion-alert');
1516
await alert.waitForVisible();
1617
await page.waitFor(250);
1718

18-
compare = await page.compareScreenshot('should open gender single select');
19-
expect(compare).toMatchScreenshot();
19+
compares.push(await page.compareScreenshot('should open gender single select'));
2020

2121
await alert.callMethod('dismiss');
2222

23-
select = await page.find('#customSelect');
23+
// Skittles Action Sheet Select
24+
select = await page.find('#skittles');
2425
await select.click();
2526

26-
const actionSheet = await page.find('ion-action-sheet');
27+
let actionSheet = await page.find('ion-action-sheet');
2728
await actionSheet.waitForVisible();
2829
await page.waitFor(250);
2930

30-
compare = await page.compareScreenshot('should open custom action sheet select');
31-
expect(compare).toMatchScreenshot();
31+
compares.push(await page.compareScreenshot('should open skittles action sheet select'));
32+
33+
await actionSheet.callMethod('dismiss');
34+
35+
// Custom Alert Select
36+
select = await page.find('#customAlertSelect');
37+
await select.click();
38+
39+
alert = await page.find('ion-alert');
40+
await alert.waitForVisible();
41+
await page.waitFor(250);
42+
43+
compares.push(await page.compareScreenshot('should open custom alert select'));
44+
45+
await alert.callMethod('dismiss');
46+
47+
// Custom Popover Select
48+
select = await page.find('#customPopoverSelect');
49+
await select.click();
50+
51+
const popover = await page.find('ion-popover');
52+
await popover.waitForVisible();
53+
await page.waitFor(250);
54+
55+
compares.push(await page.compareScreenshot('should open custom popover select'));
56+
57+
// Custom Action Sheet Select
58+
select = await page.find('#customActionSheetSelect');
59+
await select.click();
60+
61+
actionSheet = await page.find('ion-action-sheet');
62+
await actionSheet.waitForVisible();
63+
await page.waitFor(250);
64+
65+
compares.push(await page.compareScreenshot('should open custom action sheet select'));
66+
67+
await actionSheet.callMethod('dismiss');
68+
69+
for (const compare of compares) {
70+
expect(compare).toMatchScreenshot();
71+
}
3272
});

core/src/components/select/test/basic/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444

4545
<ion-item>
4646
<ion-label>Skittles</ion-label>
47-
<ion-select id="customSelect" interface="action-sheet" name="skittles">
47+
<ion-select id="skittles" interface="action-sheet" name="skittles">
4848
<ion-select-option value="red">Red</ion-select-option>
4949
<ion-select-option value="purple">Purple</ion-select-option>
5050
<ion-select-option value="yellow">Yellow</ion-select-option>

0 commit comments

Comments
 (0)