chore(): sync with main for beta 4

This commit is contained in:
Liam DeBeasi
2021-08-18 09:42:03 -04:00
23 changed files with 510 additions and 238 deletions

View File

@ -356,9 +356,9 @@
"dev": true
},
"node_modules/ionicons": {
"version": "5.5.1",
"resolved": "https://registry.npmjs.org/ionicons/-/ionicons-5.5.1.tgz",
"integrity": "sha512-1auVisfaXmkmxINer8Q3kJGHP1vSxk86hf7By95eJ+Av9+oBcNuAEBfSe3jaMaGRVxVw8U/2j23MFq7R3c0HPg==",
"version": "5.5.3",
"resolved": "https://registry.npmjs.org/ionicons/-/ionicons-5.5.3.tgz",
"integrity": "sha512-L71djrMi8pAad66tpwdnO1vwcyluCFvehzxU1PpH1k/HpYBZhZ5IaYhqXipmqUvu5aEbd4cbRguYyI5Fd4bxTw==",
"dependencies": {
"@stencil/core": "^2.5.0"
}
@ -904,9 +904,9 @@
"dev": true
},
"ionicons": {
"version": "5.5.1",
"resolved": "https://registry.npmjs.org/ionicons/-/ionicons-5.5.1.tgz",
"integrity": "sha512-1auVisfaXmkmxINer8Q3kJGHP1vSxk86hf7By95eJ+Av9+oBcNuAEBfSe3jaMaGRVxVw8U/2j23MFq7R3c0HPg==",
"version": "5.5.3",
"resolved": "https://registry.npmjs.org/ionicons/-/ionicons-5.5.3.tgz",
"integrity": "sha512-L71djrMi8pAad66tpwdnO1vwcyluCFvehzxU1PpH1k/HpYBZhZ5IaYhqXipmqUvu5aEbd4cbRguYyI5Fd4bxTw==",
"requires": {
"@stencil/core": "^2.5.0"
},

View File

@ -85,13 +85,18 @@ export const IonRouterOutlet = /*@__PURE__*/ defineComponent({
* to respond to this gesture, so check
* to make sure the view is in the outlet we want.
*/
<<<<<<< HEAD
const routeInfo = ionRouter.getCurrentRouteInfo();
const enteringViewItem = viewStacks.findViewItemByRouteInfo({ pathname: routeInfo.pushedByRoute || '' }, id);
=======
const routeInfo = ionRouter.getLeavingRouteInfo();
const enteringViewItem = viewStacks.findViewItemByRouteInfo({ pathname: routeInfo.pushedByRoute || '' }, id, usingDeprecatedRouteSetup);
>>>>>>> origin/main
return !!enteringViewItem;
}
const onStart = async () => {
const routeInfo = ionRouter.getCurrentRouteInfo();
const routeInfo = ionRouter.getLeavingRouteInfo();
const { routerAnimation } = routeInfo;
const enteringViewItem = viewStacks.findViewItemByRouteInfo({ pathname: routeInfo.pushedByRoute || '' }, id);
const leavingViewItem = viewStacks.findViewItemByRouteInfo(routeInfo, id);
@ -274,7 +279,10 @@ See https://ionicframework.com/docs/vue/navigation#ionpage for more information.
leavingViewItem.mount = false;
leavingViewItem.ionPageElement = undefined;
leavingViewItem.ionRoute = false;
viewStacks.unmountLeavingViews(id, enteringViewItem, leavingViewItem);
}
} else {
viewStacks.mountIntermediaryViews(id, enteringViewItem, leavingViewItem);
}
fireLifecycle(leavingViewItem.vueComponent, leavingViewItem.vueComponentRef, LIFECYCLE_DID_LEAVE);

View File

@ -1,5 +1,5 @@
<template>
<ion-page>
<ion-page data-pageid="inputs">
<ion-header :translucent="true">
<ion-toolbar>
<ion-buttons>

View File

@ -192,6 +192,7 @@ describe('Routing', () => {
cy.ionBackButtonHidden('home');
});
<<<<<<< HEAD
// Verifies fix for https://github.com/ionic-team/ionic-framework/issues/22662
it('should push a new instance of a parameterized page so there is a transition', () => {
cy.visit('http://localhost:8080');
@ -208,6 +209,131 @@ describe('Routing', () => {
cy.ionPageVisible('routingparameter-123')
cy.ionPageDoesNotExist('routingparameter-456');
=======
it('should select correct view when using router.go()', () => {
cy.visit('http://localhost:8080');
cy.routerPush('/routing');
cy.ionPageVisible('routing');
cy.ionPageHidden('home');
cy.routerPush('/routing/abc');
cy.ionPageVisible('routingparameter');
cy.ionPageHidden('routing');
cy.routerGo(-2);
cy.ionPageVisible('home');
cy.ionPageDoesNotExist('routingparameter');
cy.routerGo(2);
cy.ionPageVisible('routingparameter');
cy.ionPageHidden('home');
cy.ionBackClick('routingparameter');
cy.ionPageDoesNotExist('routingparameter');
cy.ionPageVisible('routing');
})
it('should select correct view when traversing backward and forward through history', () => {
cy.visit('http://localhost:8080');
cy.routerPush('/routing');
cy.ionPageVisible('routing');
cy.ionPageHidden('home');
cy.routerPush('/routing/abc');
cy.ionPageVisible('routingparameter');
cy.ionPageHidden('routing');
cy.routerGo(-2);
cy.ionPageVisible('home');
cy.ionPageDoesNotExist('routingparameter');
cy.routerGo(1);
cy.ionPageHidden('home');
cy.ionPageVisible('routing');
cy.routerGo(1);
cy.ionPageHidden('routing');
cy.ionPageVisible('routingparameter');
cy.routerGo(-1);
cy.ionPageDoesNotExist('routingparameter');
cy.ionPageVisible('routing');
cy.routerGo(-1);
cy.ionPageDoesNotExist('routing');
cy.ionPageVisible('home');
})
it('should create new stack items when going back then pushing pages', () => {
cy.visit('http://localhost:8080');
cy.routerPush('/routing');
cy.ionPageVisible('routing');
cy.ionPageHidden('home');
cy.routerPush('/routing/abc');
cy.ionPageVisible('routingparameter');
cy.ionPageHidden('routing');
cy.routerGo(-2);
cy.ionPageVisible('home');
cy.ionPageDoesNotExist('routingparameter');
cy.routerPush('/inputs');
cy.ionPageHidden('home');
cy.ionPageVisible('inputs');
cy.ionBackClick('inputs');
cy.ionPageVisible('home');
cy.ionPageDoesNotExist('inputs');
})
it('should properly go back using ion-back-button after using router.go()', () => {
cy.visit('http://localhost:8080');
cy.routerPush('/routing');
cy.ionPageVisible('routing');
cy.ionPageHidden('home');
cy.routerPush('/routing/abc');
cy.ionPageVisible('routingparameter');
cy.ionPageHidden('routing');
cy.routerGo(-2);
cy.ionPageVisible('home');
cy.ionPageDoesNotExist('routingparameter');
cy.routerGo(2);
cy.ionPageVisible('routingparameter');
cy.ionPageHidden('home');
cy.ionBackClick('routingparameter');
cy.ionPageDoesNotExist('routingparameter');
cy.ionPageVisible('routing');
cy.ionBackClick('routing');
cy.ionPageDoesNotExist('routing');
cy.ionPageVisible('home');
});
it('should unmount views skipped over by using router.go with a negative value', () => {
cy.visit('http://localhost:8080');
cy.routerPush('/routing');
cy.ionPageVisible('routing');
cy.ionPageHidden('home');
cy.routerPush('/routing/abc');
cy.ionPageVisible('routingparameter');
cy.ionPageHidden('routing');
cy.routerGo(-2);
cy.ionPageVisible('home');
cy.ionPageDoesNotExist('routing');
cy.ionPageDoesNotExist('routingparameter');
>>>>>>> origin/main
})
});
@ -233,4 +359,30 @@ describe('Routing - Swipe to Go Back', () => {
// TODO: Vue router does not go back in cypress with router.back()
//cy.ionPageDoesNotExist('navigation');
});
it('swipe to go back should work when using router.go()', () => {
cy.visit('http://localhost:8080?ionic:mode=ios');
cy.routerPush('/routing');
cy.ionPageVisible('routing');
cy.ionPageHidden('home');
cy.routerPush('/routing/abc');
cy.ionPageVisible('routingparameter');
cy.ionPageHidden('routing');
cy.routerGo(-2);
cy.ionPageVisible('home');
cy.ionPageDoesNotExist('routingparameter');
cy.routerGo(2);
cy.ionPageVisible('routingparameter');
cy.ionPageHidden('home');
// TODO: This does not work yet
cy.ionSwipeToGoBack(true);
cy.ionPageDoesNotExist('routingparameter');
cy.ionPageVisible('routing');
})
})

View File

@ -76,6 +76,12 @@ Cypress.Commands.add('routerReplace', (path) => {
});
});
Cypress.Commands.add('routerGo', (n) => {
cy.window().then(win => {
win.debugRouter.go(n);
});
});
Cypress.Commands.add('ionBackButtonHidden', (pageId) => {
cy.get(`div.ion-page[data-pageid=${pageId}]`)
.should('be.visible', true)