Skip to content

Commit 4f8d5fd

Browse files
committed
added e2e test
1 parent 355bdb2 commit 4f8d5fd

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

core/src/components/modal/test/sheet/modal.e2e.ts

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,46 @@ configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
2222
animations: 'allow',
2323
});
2424
});
25+
test('should have working eventListener in ion-footer when expandToScroll is false', async ({ page }) => {
26+
await page.goto('/src/components/modal/test/sheet', config);
27+
test.info().annotations.push({
28+
type: 'issue',
29+
description: 'https://github.com/ionic-team/ionic-framework/issues/30315',
30+
});
31+
32+
await page.setContent(
33+
`
34+
<ion-content>
35+
<ion-button id="open-modal">Open</ion-button>
36+
<ion-modal trigger="open-modal" initial-breakpoint="0.25" expandToScroll="false">
37+
<ion-footer>
38+
<ion-toolbar>
39+
<ion-button id="dismiss">Dismiss</ion-button>
40+
</ion-toolbar>
41+
</ion-footer>
42+
</ion-modal>
43+
</ion-content>
44+
<script>
45+
const modal = document.querySelector('ion-modal');
46+
47+
const dismiss = document.querySelector('#dismiss');
48+
dismiss.addEventListener('click', () => {
49+
modal.dismiss();
50+
});
51+
</script>
52+
`,
53+
config
54+
);
55+
56+
const ionModalDidPresent = await page.spyOnEvent('ionModalDidPresent');
57+
const ionModalDidDismiss = await page.spyOnEvent('ionModalDidDismiss');
58+
59+
await page.click('#open-modal');
60+
await ionModalDidPresent.next();
61+
62+
await page.click('#dismiss');
63+
await ionModalDidDismiss.next();
64+
});
2565
});
2666
});
2767

0 commit comments

Comments
 (0)