|
1 | 1 | import { expect } from '@playwright/test'; |
2 | | -import { configs, test, Viewports } from '@utils/test/playwright'; |
3 | 2 | import type { E2EPage } from '@utils/test/playwright'; |
| 3 | +import { configs, test, Viewports } from '@utils/test/playwright'; |
4 | 4 |
|
5 | 5 | configs({ modes: ['ios'], directions: ['ltr'] }).forEach(({ title, config }) => { |
6 | 6 | test.describe(title('modal: focus trapping'), () => { |
@@ -104,6 +104,28 @@ configs().forEach(({ title, screenshot, config }) => { |
104 | 104 | }); |
105 | 105 |
|
106 | 106 | configs({ modes: ['ios'], directions: ['ltr'] }).forEach(({ title, config }) => { |
| 107 | + test.describe(title('modal: parent removal observer'), () => { |
| 108 | + test('should not set up parentRemovalObserver for controller-created modals', async ({ page }, testInfo) => { |
| 109 | + testInfo.annotations.push({ |
| 110 | + type: 'issue', |
| 111 | + description: 'https://github.com/ionic-team/ionic-framework/pull/30845', |
| 112 | + }); |
| 113 | + |
| 114 | + await page.goto('/src/components/modal/test/basic', config); |
| 115 | + const ionModalDidPresent = await page.spyOnEvent('ionModalDidPresent'); |
| 116 | + |
| 117 | + await page.click('#basic-modal'); |
| 118 | + await ionModalDidPresent.next(); |
| 119 | + |
| 120 | + const modal = page.locator('ion-modal'); |
| 121 | + const hasObserver = await modal.evaluate((el: any) => { |
| 122 | + return el.parentRemovalObserver !== undefined; |
| 123 | + }); |
| 124 | + |
| 125 | + expect(hasObserver).toBe(false); |
| 126 | + }); |
| 127 | + }); |
| 128 | + |
107 | 129 | test.describe(title('modal: backdrop'), () => { |
108 | 130 | test.beforeEach(async ({ page }) => { |
109 | 131 | await page.goto('/src/components/modal/test/basic', config); |
|
0 commit comments