|
1 | 1 | import { test, expect } from '@playwright/test'; |
2 | 2 | import { |
3 | 3 | ionPageVisible, ionPageHidden, ionPageDoesNotExist, |
4 | | - ionNav, ionBackClick, ionTabClick, withTestingMode |
| 4 | + ionNav, ionBackClick, ionTabClick, ionGoBack, withTestingMode |
5 | 5 | } from './utils/test-utils'; |
6 | 6 |
|
7 | 7 | test.describe('Tabs', () => { |
@@ -36,6 +36,34 @@ test.describe('Tabs', () => { |
36 | 36 | await ionPageDoesNotExist(page, 'tab1'); |
37 | 37 | }); |
38 | 38 |
|
| 39 | + // Verifies fix for https://github.com/ionic-team/ionic-framework/issues/25141 |
| 40 | + test('browser back from preserved child page should sync URL and display', async ({ page }, testInfo) => { |
| 41 | + testInfo.annotations.push({ |
| 42 | + type: 'issue', |
| 43 | + description: 'https://github.com/ionic-team/ionic-framework/issues/25141', |
| 44 | + }); |
| 45 | + |
| 46 | + await page.goto(withTestingMode('/tabs/tab1')); |
| 47 | + await ionPageVisible(page, 'tab1'); |
| 48 | + |
| 49 | + await page.locator('#child-one').click(); |
| 50 | + await ionPageHidden(page, 'tab1'); |
| 51 | + await ionPageVisible(page, 'tab1child1'); |
| 52 | + |
| 53 | + await ionTabClick(page, 'Tab2'); |
| 54 | + await ionPageHidden(page, 'tab1child1'); |
| 55 | + await ionPageVisible(page, 'tab2'); |
| 56 | + |
| 57 | + await ionTabClick(page, 'Tab1'); |
| 58 | + await ionPageHidden(page, 'tab2'); |
| 59 | + await ionPageVisible(page, 'tab1child1'); |
| 60 | + |
| 61 | + await ionGoBack(page, '/tabs/tab1'); |
| 62 | + await ionPageDoesNotExist(page, 'tab1child1'); |
| 63 | + await ionPageVisible(page, 'tab1'); |
| 64 | + await expect(page.locator('ion-tab-button.tab-selected')).toContainText('Tab1'); |
| 65 | + }); |
| 66 | + |
39 | 67 | // Verifies fix for https://github.com/ionic-team/ionic-framework/issues/23087 |
40 | 68 | test('should return to correct view and url when going back from child page after switching tabs', async ({ page }) => { |
41 | 69 | await page.goto(withTestingMode('/tabs/tab1')); |
|
0 commit comments