test(angular): add navigation tests (#16494)

This commit is contained in:
Manu MA
2018-11-28 18:17:44 +01:00
committed by GitHub
parent e6f9d37301
commit 2d0e0bafea
30 changed files with 547 additions and 48 deletions

View File

@ -23,7 +23,7 @@ export class NavController {
if (ev instanceof NavigationStart) {
const id = (ev.restoredState) ? ev.restoredState.navigationId : ev.id;
this.guessDirection = id < this.lastNavId ? 'back' : 'forward';
this.lastNavId = id;
this.lastNavId = this.guessDirection === 'forward' ? ev.id : id;
}
});
@ -77,6 +77,7 @@ export class NavController {
if (this.direction === 'auto') {
direction = this.guessDirection;
console.log('guessed', direction);
animated = direction !== 'root';
} else {
animated = this.animated;