mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-17 10:41:13 +08:00
fix(vue): correctly switch tabs after going back (#22309)
resolves #22307
This commit is contained in:
@ -17,7 +17,7 @@
|
||||
|
||||
<ExploreContainer name="Tab 1 page" />
|
||||
|
||||
<ion-item router-link="tab1/child-one" id="child-one">
|
||||
<ion-item router-link="/tabs/tab1/child-one" id="child-one">
|
||||
<ion-label>Go to Tab 1 Child 1</ion-label>
|
||||
</ion-item>
|
||||
<ion-item router-link="/nested" id="nested">
|
||||
|
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<ion-page>
|
||||
<ion-page data-pageid="tab3-secondary">
|
||||
<ion-header>
|
||||
<ion-toolbar>
|
||||
<ion-title>Tab 3 - Secondary</ion-title>
|
||||
|
@ -122,6 +122,31 @@ describe('Tabs', () => {
|
||||
cy.ionPageDoesNotExist('tab3');
|
||||
cy.ionPageVisible('tabs');
|
||||
});
|
||||
|
||||
// Verifies fix for https://github.com/ionic-team/ionic-framework/issues/22307
|
||||
it('should select correct tab after going back', () => {
|
||||
cy.visit('http://localhost:8080/tabs-secondary/tab1');
|
||||
|
||||
cy.get('ion-tab-button#tab-button-tab2-secondary').click();
|
||||
cy.ionPageVisible('tab2-secondary');
|
||||
cy.ionPageHidden('tab1-secondary');
|
||||
|
||||
cy.get('ion-tab-button#tab-button-tab3-secondary').click();
|
||||
cy.ionPageVisible('tab3-secondary');
|
||||
cy.ionPageHidden('tab2-secondary');
|
||||
|
||||
cy.go('back');
|
||||
cy.ionPageVisible('tab2-secondary');
|
||||
cy.ionPageHidden('tab3-secondary');
|
||||
|
||||
cy.go('back');
|
||||
cy.ionPageVisible('tab1-secondary');
|
||||
cy.ionPageHidden('tab2-secondary');
|
||||
|
||||
cy.get('ion-tab-button#tab-button-tab3-secondary').click();
|
||||
cy.ionPageVisible('tab3-secondary');
|
||||
cy.ionPageHidden('tab1-secondary');
|
||||
});
|
||||
})
|
||||
|
||||
describe('Tabs - Swipe to Go Back', () => {
|
||||
|
Reference in New Issue
Block a user