fix(vue): improve path matching with tabs (#22807)

resolves #22519
This commit is contained in:
Liam DeBeasi
2021-01-22 10:19:38 -05:00
committed by GitHub
parent e2d8e5c4dc
commit 2a3ce9a74e
5 changed files with 100 additions and 18 deletions

View File

@ -172,7 +172,41 @@ describe('Tabs', () => {
cy.ionPageVisible('tab1');
cy.ionPageHidden('routing');
cy.ionPageHidden('tab2');
})
});
// Verifies 1 of 2 fixes for https://github.com/ionic-team/ionic-framework/issues/22519
it('should not create a new tabs instance when switching between tabbed and non-tabbed contexts', () => {
cy.visit('http://localhost:8080/tabs/tab1');
cy.routerPush('/');
cy.ionPageHidden('tabs');
cy.ionPageVisible('home');
cy.routerPush('/tabs/tab2');
cy.ionPageHidden('tab1');
cy.ionPageHidden('home');
cy.ionPageVisible('tab2');
cy.ionPageVisible('tabs');
});
// Verifies 1 of 2 fixes for https://github.com/ionic-team/ionic-framework/issues/22519
it('should not create a new tabs instance when switching between tabbed and non-tabbed contexts - new tabs setup', () => {
cy.visit('http://localhost:8080/tabs-new/tab1');
cy.routerPush('/');
cy.ionPageHidden('tabs');
cy.ionPageVisible('home');
cy.routerPush('/tabs-new/tab2');
cy.ionPageHidden('tab1');
cy.ionPageHidden('home');
cy.ionPageVisible('tab2');
cy.ionPageVisible('tabs');
});
})
describe('Tabs - Swipe to Go Back', () => {

View File

@ -68,6 +68,7 @@ describe('ion-tab-bar', () => {
});
const innerHTML = wrapper.find('ion-tabs').html();
// TODO: Remove tabs="true" in Ionic Vue v6.0
expect(innerHTML).toContain(`<div class="tabs-inner" style="position: relative; flex: 1; contain: layout size style;"><ion-router-outlet tabs="true"></ion-router-outlet></div><ion-tab-bar slot="bottom"></ion-tab-bar>`);
});
@ -100,6 +101,7 @@ describe('ion-tab-bar', () => {
});
const innerHTML = wrapper.find('ion-tabs').html();
// TODO: Remove tabs="true" in Ionic Vue v6.0
expect(innerHTML).toContain(`<div class="tabs-inner" style="position: relative; flex: 1; contain: layout size style;"><ion-router-outlet tabs="true"></ion-router-outlet></div><ion-tab-bar></ion-tab-bar></ion-tabs>`)
});