fix(vue): switching between tabs and going back resolves to correct route (#25206)

resolves #24303
This commit is contained in:
Liam DeBeasi
2022-04-29 10:11:55 -04:00
committed by GitHub
parent 2fbd6218ce
commit b4ba70ea14
7 changed files with 296 additions and 13 deletions

View File

@ -106,3 +106,15 @@ Cypress.Commands.add('ionBackButtonHidden', (pageId) => {
.find('ion-back-button')
.should('not.be.visible')
});
/**
* If running in a browser, hardwareBackButton: true
* must be set in Ionic config for this to work.
*/
Cypress.Commands.add('hardwareBackButton', () => {
cy.document().then(doc => {
const ev = new CustomEvent('backbutton');
doc.dispatchEvent(ev);
})
})