|
1 | 1 | import { expect, test } from '@playwright/test'; |
2 | 2 |
|
3 | 3 | /** |
4 | | - * Tests for INLINE sheet modals in child routes with showBackdrop=false. |
5 | | - * |
6 | | - * Related issue: https://github.com/ionic-team/ionic-framework/issues/30700 |
7 | | - * |
8 | | - * This test mimics the EXACT structure from the issue reproduction: |
9 | | - * - PARENT component has interactive content (buttons) AND a nested ion-router-outlet |
10 | | - * - CHILD route (rendered in that nested outlet) contains ONLY the modal |
11 | | - * - The modal has showBackdrop=false |
12 | | - * |
13 | | - * The bug: when the modal opens in the child route, the buttons in the PARENT |
14 | | - * become non-interactive even though showBackdrop=false should allow interaction. |
15 | | - * |
16 | | - * DOM structure: |
17 | | - * - ion-app > ion-router-outlet (root) > PARENT (buttons + nested outlet) > ion-router-outlet > CHILD (modal only) |
| 4 | + * Tests for sheet modals in child routes with showBackdrop=false. |
| 5 | + * Parent has buttons + nested outlet; child route contains only the modal. |
| 6 | + * See https://github.com/ionic-team/ionic-framework/issues/30700 |
18 | 7 | */ |
19 | 8 | test.describe('Modals: Inline Sheet in Child Route (standalone)', () => { |
20 | 9 | test.beforeEach(async ({ page }) => { |
21 | | - // Navigate to the child route - this will: |
22 | | - // 1. Render the parent with buttons |
23 | | - // 2. Render the child in the nested outlet, which immediately opens the modal |
24 | 10 | await page.goto('/standalone/modal-child-route/child'); |
25 | 11 | }); |
26 | 12 |
|
27 | 13 | test('should render parent content and child modal', async ({ page }) => { |
28 | | - // Verify the PARENT content is visible (buttons are in parent, not child) |
29 | 14 | await expect(page.locator('#increment-btn')).toBeVisible(); |
30 | 15 | await expect(page.locator('#decrement-btn')).toBeVisible(); |
31 | 16 | await expect(page.locator('#background-action-count')).toHaveText('0'); |
32 | | - |
33 | | - // Verify the modal from CHILD route is visible (opens immediately with isOpen=true) |
34 | 17 | await expect(page.locator('ion-modal.show-modal')).toBeVisible(); |
35 | 18 | await expect(page.locator('#modal-content-loaded')).toBeVisible(); |
36 | 19 | }); |
37 | 20 |
|
38 | | - test('should allow interacting with PARENT content while modal (showBackdrop: false) is open in CHILD route', async ({ page }) => { |
39 | | - // Modal should already be open (isOpen=true in child component) |
| 21 | + test('should allow interacting with parent content while modal is open in child route', async ({ page }) => { |
40 | 22 | await expect(page.locator('ion-modal.show-modal')).toBeVisible(); |
41 | | - await expect(page.locator('#modal-content-loaded')).toBeVisible(); |
42 | 23 |
|
43 | | - // Click the increment button in the PARENT - this should work with showBackdrop=false |
44 | | - // This is the KEY test - it FAILS due to issue #30700 |
45 | 24 | await page.locator('#increment-btn').click(); |
46 | | - |
47 | | - // Verify the click was registered |
48 | 25 | await expect(page.locator('#background-action-count')).toHaveText('1'); |
49 | 26 | }); |
50 | 27 |
|
51 | | - test('should allow multiple interactions with PARENT content while modal is open', async ({ page }) => { |
52 | | - // Modal should already be open |
| 28 | + test('should allow multiple interactions with parent content while modal is open', async ({ page }) => { |
53 | 29 | await expect(page.locator('ion-modal.show-modal')).toBeVisible(); |
54 | 30 |
|
55 | | - // Click increment multiple times |
56 | 31 | await page.locator('#increment-btn').click(); |
57 | 32 | await page.locator('#increment-btn').click(); |
58 | 33 | await expect(page.locator('#background-action-count')).toHaveText('2'); |
59 | 34 |
|
60 | | - // Click decrement |
61 | 35 | await page.locator('#decrement-btn').click(); |
62 | 36 | await expect(page.locator('#background-action-count')).toHaveText('1'); |
63 | 37 | }); |
|
0 commit comments