diff --git a/src/components/app/test/app.spec.ts b/src/components/app/test/app.spec.ts index 40012e6002..17e9a00cca 100644 --- a/src/components/app/test/app.spec.ts +++ b/src/components/app/test/app.spec.ts @@ -7,7 +7,7 @@ import { Platform } from '../../../platform/platform'; describe('App', () => { - describe('navPop', () => { + describe('goBack', () => { it('should select the previous tab', () => { let nav = mockNavController(); @@ -29,7 +29,7 @@ describe('App', () => { spyOn(tab2, 'pop'); spyOn(portal, 'pop'); - app.navPop(); + app.goBack(); expect(tabs.select).toHaveBeenCalledWith(tab1); expect(tab1.pop).not.toHaveBeenCalled(); @@ -58,7 +58,7 @@ describe('App', () => { let view2 = mockView(); tab2._views = [view1, view2]; - app.navPop(); + app.goBack(); expect(tab2.pop).toHaveBeenCalled(); expect(portal.pop).not.toHaveBeenCalled(); @@ -81,7 +81,7 @@ describe('App', () => { let view2 = mockView(); tab2._views = [view1, view2]; - app.navPop(); + app.goBack(); expect(tab2.pop).toHaveBeenCalled(); expect(platform.exitApp).not.toHaveBeenCalled(); @@ -106,7 +106,7 @@ describe('App', () => { let nestedView1 = mockView(); mockViews(nestedNav, [nestedView1]); - app.navPop(); + app.goBack(); expect(portal.pop).not.toHaveBeenCalled(); expect(rootNav.pop).toHaveBeenCalled(); @@ -133,7 +133,7 @@ describe('App', () => { let nestedView2 = mockView(); mockViews(nestedNav, [nestedView1, nestedView2]); - app.navPop(); + app.goBack(); expect(portal.pop).not.toHaveBeenCalled(); expect(rootNav.pop).not.toHaveBeenCalled(); @@ -156,7 +156,7 @@ describe('App', () => { let overlay1 = mockView(); mockViews(portal, [overlay1]); - app.navPop(); + app.goBack(); expect(portal.pop).toHaveBeenCalled(); expect(nav.pop).not.toHaveBeenCalled(); @@ -175,7 +175,7 @@ describe('App', () => { let view2 = mockView(); mockViews(nav, [view1, view2]); - app.navPop(); + app.goBack(); expect(portal.pop).not.toHaveBeenCalled(); expect(nav.pop).toHaveBeenCalled(); @@ -196,7 +196,7 @@ describe('App', () => { expect(app.getActiveNav()).toBe(nav); expect(nav.first()).toBe(view1); - app.navPop(); + app.goBack(); expect(portal.pop).not.toHaveBeenCalled(); expect(nav.pop).not.toHaveBeenCalled(); @@ -219,7 +219,7 @@ describe('App', () => { expect(app.getActiveNav()).toBe(nav); expect(nav.first()).toBe(view1); - app.navPop(); + app.goBack(); expect(portal.pop).not.toHaveBeenCalled(); expect(nav.pop).not.toHaveBeenCalled(); @@ -239,7 +239,7 @@ describe('App', () => { app.setEnabled(false, 10000); - app.navPop(); + app.goBack(); expect(portal.pop).not.toHaveBeenCalled(); expect(nav.pop).not.toHaveBeenCalled(); @@ -249,7 +249,7 @@ describe('App', () => { it('should not go back if there is no root nav', () => { spyOn(platform, 'exitApp'); - app.navPop(); + app.goBack(); expect(platform.exitApp).not.toHaveBeenCalled(); }); diff --git a/src/navigation/nav-controller-base.ts b/src/navigation/nav-controller-base.ts index 3d1e318f08..fcdb828c39 100644 --- a/src/navigation/nav-controller-base.ts +++ b/src/navigation/nav-controller-base.ts @@ -25,7 +25,7 @@ import { DomController } from '../util/dom-controller'; */ export class NavControllerBase extends Ion implements NavController { - _children: NavController[] = []; + _children: any[] = []; _ids: number = -1; _init = false; _isPortal: boolean; @@ -883,15 +883,15 @@ export class NavControllerBase extends Ion implements NavController { this._app.viewWillUnload.emit(view); } - getActiveChildNav(): NavController { + getActiveChildNav(): any { return this._children[this._children.length - 1]; } - registerChildNav(nav: NavController) { + registerChildNav(nav: any) { this._children.push(nav); } - unregisterChildNav(nav: NavController) { + unregisterChildNav(nav: any) { removeArrayItem(this._children, nav); } diff --git a/src/navigation/nav-controller.ts b/src/navigation/nav-controller.ts index 6098ac9252..544ee65077 100644 --- a/src/navigation/nav-controller.ts +++ b/src/navigation/nav-controller.ts @@ -600,5 +600,5 @@ export abstract class NavController { /** * @private */ - abstract registerChildNav(nav: NavController); + abstract registerChildNav(nav: any); }