mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 03:32:21 +08:00
fix navcontroller tests
This commit is contained in:
@ -46,7 +46,7 @@ export function run() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
destroys.forEach(view => {
|
destroys.forEach(view => {
|
||||||
nav.remove(view);
|
nav._remove(view);
|
||||||
view.destroy();
|
view.destroy();
|
||||||
});
|
});
|
||||||
cb();
|
cb();
|
||||||
@ -75,7 +75,7 @@ export function run() {
|
|||||||
let activeView = new ViewController();
|
let activeView = new ViewController();
|
||||||
activeView.state = 1; // ACTIVE_STATE
|
activeView.state = 1; // ACTIVE_STATE
|
||||||
|
|
||||||
nav.add(activeView);
|
nav._add(activeView);
|
||||||
var active = nav.getActive();
|
var active = nav.getActive();
|
||||||
|
|
||||||
expect(active).toBe(activeView);
|
expect(active).toBe(activeView);
|
||||||
@ -83,7 +83,7 @@ export function run() {
|
|||||||
let secondActiveView = new ViewController();
|
let secondActiveView = new ViewController();
|
||||||
secondActiveView.state = 1; // ACTIVE_STATE
|
secondActiveView.state = 1; // ACTIVE_STATE
|
||||||
|
|
||||||
nav.add(secondActiveView);
|
nav._add(secondActiveView);
|
||||||
active = nav.getActive();
|
active = nav.getActive();
|
||||||
|
|
||||||
expect(active).toBe(activeView);
|
expect(active).toBe(activeView);
|
||||||
@ -122,11 +122,11 @@ export function run() {
|
|||||||
expect(FirstPage).toBeDefined();
|
expect(FirstPage).toBeDefined();
|
||||||
expect(nav._views.length).toBe(0);
|
expect(nav._views.length).toBe(0);
|
||||||
|
|
||||||
spyOn(nav, 'add').and.callThrough();
|
spyOn(nav, '_add').and.callThrough();
|
||||||
|
|
||||||
nav.transition = mockTransitionFn;
|
nav.transition = mockTransitionFn;
|
||||||
nav.push(FirstPage, {}, {}).then(() => {
|
nav.push(FirstPage, {}, {}).then(() => {
|
||||||
expect(nav.add).toHaveBeenCalled();
|
expect(nav._add).toHaveBeenCalled();
|
||||||
expect(nav._views.length).toBe(1);
|
expect(nav._views.length).toBe(1);
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user