parent
4ba4427510
commit
557d309377
|
@ -208,8 +208,8 @@ function commonTests() {
|
|||
macroTask(() => {
|
||||
expect(_log.result()).toEqual('run; onTurnDone; onEventDone');
|
||||
async.done();
|
||||
}, 80);
|
||||
}));
|
||||
}, 150);
|
||||
}), 200);
|
||||
|
||||
it('should run async tasks scheduled inside onEventDone outside Angular zone',
|
||||
inject([AsyncTestCompleter], (async) => {
|
||||
|
@ -230,7 +230,7 @@ function commonTests() {
|
|||
TimerWrapper.setTimeout(() => {
|
||||
expect(_log.result()).toEqual('run; onTurnDone; onEventDone; asyncTask');
|
||||
async.done();
|
||||
}, 10);
|
||||
}, 20);
|
||||
});
|
||||
}));
|
||||
|
||||
|
@ -402,8 +402,8 @@ function commonTests() {
|
|||
// Second VM Turn => microtask enqueued from onTurnDone
|
||||
'onTurnStart; executedMicrotask; onTurnDone(begin); onTurnDone(end)');
|
||||
async.done();
|
||||
}, 80);
|
||||
}));
|
||||
}, 150);
|
||||
}), 200);
|
||||
|
||||
it('should call onTurnStart and onTurnDone for a scheduleMicrotask in onTurnDone triggered by ' +
|
||||
'a scheduleMicrotask in run',
|
||||
|
@ -437,8 +437,8 @@ function commonTests() {
|
|||
// Second VM Turn => the microtask enqueued from onTurnDone
|
||||
'onTurnStart; onTurnDone(executeMicrotask); onTurnDone(begin); onTurnDone(end)');
|
||||
async.done();
|
||||
}, 80);
|
||||
}));
|
||||
}, 150);
|
||||
}), 200);
|
||||
|
||||
it('should execute promises scheduled in onTurnStart before promises scheduled in run',
|
||||
inject([AsyncTestCompleter], (async) => {
|
||||
|
@ -492,8 +492,8 @@ function commonTests() {
|
|||
// Second VM turn: execute the microtask from onTurnEnd
|
||||
'onTurnStart(begin); onTurnStart(end); onTurnDone(executePromise); onTurnDone(begin); onTurnDone(end)');
|
||||
async.done();
|
||||
}, 80);
|
||||
}));
|
||||
}, 150);
|
||||
}), 200);
|
||||
|
||||
it('should call onTurnStart and onTurnDone before and after each turn, respectively',
|
||||
inject([AsyncTestCompleter], (async) => {
|
||||
|
@ -513,7 +513,7 @@ function commonTests() {
|
|||
macroTask(() => { _zone.run(() => { completerA.resolve(null); }); }, 20);
|
||||
|
||||
|
||||
macroTask(() => { _zone.run(() => { completerB.resolve(null); }); }, 100);
|
||||
macroTask(() => { _zone.run(() => { completerB.resolve(null); }); }, 120);
|
||||
|
||||
macroTask(() => {
|
||||
expect(_log.result())
|
||||
|
@ -545,8 +545,8 @@ function commonTests() {
|
|||
expect(_log.result())
|
||||
.toEqual('onTurnStart; run start; run end; async1; async2; onTurnDone');
|
||||
async.done();
|
||||
}, 80);
|
||||
}));
|
||||
}, 150);
|
||||
}), 200);
|
||||
|
||||
it('should call onTurnStart and onTurnDone for promises created outside of run body',
|
||||
inject([AsyncTestCompleter], (async) => {
|
||||
|
@ -567,8 +567,8 @@ function commonTests() {
|
|||
expect(_log.result())
|
||||
.toEqual('onTurnStart; zone run; onTurnDone; onTurnStart; promise then; onTurnDone');
|
||||
async.done();
|
||||
}, 80);
|
||||
}));
|
||||
}, 150);
|
||||
}), 200);
|
||||
});
|
||||
|
||||
describe('exceptions', () => {
|
||||
|
|
|
@ -100,7 +100,7 @@ export function main() {
|
|||
expect(log).toEqual(['activate: null -> /on-activate']);
|
||||
async.done();
|
||||
});
|
||||
}));
|
||||
}), 2000);
|
||||
|
||||
it('should wait for a parent component\'s onActivate hook to resolve before calling its child\'s',
|
||||
inject([AsyncTestCompleter], (async) => {
|
||||
|
@ -123,7 +123,7 @@ export function main() {
|
|||
async.done();
|
||||
});
|
||||
});
|
||||
}));
|
||||
}), 2000);
|
||||
|
||||
it('should call the onDeactivate hook', inject([AsyncTestCompleter], (async) => {
|
||||
compile()
|
||||
|
@ -136,7 +136,7 @@ export function main() {
|
|||
expect(log).toEqual(['deactivate: /on-deactivate -> /a']);
|
||||
async.done();
|
||||
});
|
||||
}));
|
||||
}), 2000);
|
||||
|
||||
it('should wait for a child component\'s onDeactivate hook to resolve before calling its parent\'s',
|
||||
inject([AsyncTestCompleter], (async) => {
|
||||
|
@ -161,7 +161,7 @@ export function main() {
|
|||
async.done();
|
||||
});
|
||||
});
|
||||
}));
|
||||
}), 2000);
|
||||
|
||||
it('should reuse a component when the canReuse hook returns true',
|
||||
inject([AsyncTestCompleter], (async) => {
|
||||
|
@ -182,7 +182,7 @@ export function main() {
|
|||
expect(cmpInstanceCount).toBe(1);
|
||||
async.done();
|
||||
});
|
||||
}));
|
||||
}), 2000);
|
||||
|
||||
|
||||
it('should not reuse a component when the canReuse hook returns false',
|
||||
|
@ -204,7 +204,7 @@ export function main() {
|
|||
expect(cmpInstanceCount).toBe(2);
|
||||
async.done();
|
||||
});
|
||||
}));
|
||||
}), 2000);
|
||||
|
||||
|
||||
it('should navigate when canActivate returns true', inject([AsyncTestCompleter], (async) => {
|
||||
|
@ -224,7 +224,7 @@ export function main() {
|
|||
async.done();
|
||||
});
|
||||
});
|
||||
}));
|
||||
}), 2000);
|
||||
|
||||
it('should not navigate when canActivate returns false',
|
||||
inject([AsyncTestCompleter], (async) => {
|
||||
|
@ -244,7 +244,7 @@ export function main() {
|
|||
async.done();
|
||||
});
|
||||
});
|
||||
}));
|
||||
}), 2000);
|
||||
|
||||
it('should navigate away when canDeactivate returns true',
|
||||
inject([AsyncTestCompleter], (async) => {
|
||||
|
@ -269,7 +269,7 @@ export function main() {
|
|||
async.done();
|
||||
});
|
||||
});
|
||||
}));
|
||||
}), 2000);
|
||||
|
||||
it('should not navigate away when canDeactivate returns false',
|
||||
inject([AsyncTestCompleter], (async) => {
|
||||
|
@ -294,7 +294,7 @@ export function main() {
|
|||
async.done();
|
||||
});
|
||||
});
|
||||
}));
|
||||
}), 2000);
|
||||
|
||||
|
||||
it('should run activation and deactivation hooks in the correct order',
|
||||
|
@ -322,7 +322,7 @@ export function main() {
|
|||
]);
|
||||
async.done();
|
||||
});
|
||||
}));
|
||||
}), 2000);
|
||||
|
||||
it('should only run reuse hooks when reusing', inject([AsyncTestCompleter], (async) => {
|
||||
compile()
|
||||
|
@ -349,7 +349,7 @@ export function main() {
|
|||
]);
|
||||
async.done();
|
||||
});
|
||||
}));
|
||||
}), 2000);
|
||||
|
||||
it('should not run reuse hooks when not reusing', inject([AsyncTestCompleter], (async) => {
|
||||
compile()
|
||||
|
@ -378,7 +378,7 @@ export function main() {
|
|||
]);
|
||||
async.done();
|
||||
});
|
||||
}));
|
||||
}), 2000);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -62,7 +62,7 @@ export function main() {
|
|||
async.done();
|
||||
});
|
||||
});
|
||||
}));
|
||||
}), 1000);
|
||||
});
|
||||
|
||||
describe('broken app', () => {
|
||||
|
@ -78,7 +78,7 @@ export function main() {
|
|||
async.done();
|
||||
});
|
||||
});
|
||||
}));
|
||||
}), 1000);
|
||||
});
|
||||
|
||||
describe('back button app', () => {
|
||||
|
@ -148,26 +148,27 @@ export function main() {
|
|||
});
|
||||
router.navigate('/parent/child');
|
||||
});
|
||||
}));
|
||||
}), 1000);
|
||||
|
||||
describe('custom app base ref', () => {
|
||||
beforeEachBindings(() => { return [bind(APP_BASE_HREF).toValue('/my/app')]; });
|
||||
it('should bootstrap', inject([AsyncTestCompleter, TestComponentBuilder],
|
||||
it('should bootstrap',
|
||||
inject([AsyncTestCompleter, TestComponentBuilder],
|
||||
(async, tcb: TestComponentBuilder) => {
|
||||
|
||||
tcb.createAsync(HierarchyAppCmp)
|
||||
.then((rootTC) => {
|
||||
var router = rootTC.componentInstance.router;
|
||||
router.subscribe((_) => {
|
||||
expect(rootTC.nativeElement)
|
||||
.toHaveText('root { parent { hello } }');
|
||||
expect(rootTC.nativeElement).toHaveText('root { parent { hello } }');
|
||||
expect(rootTC.componentInstance.location.path())
|
||||
.toEqual('/my/app/parent/child');
|
||||
async.done();
|
||||
});
|
||||
router.navigate('/parent/child');
|
||||
});
|
||||
}));
|
||||
}),
|
||||
1000);
|
||||
});
|
||||
});
|
||||
// TODO: add a test in which the child component has bindings
|
||||
|
@ -192,7 +193,7 @@ export function main() {
|
|||
router.navigate('/qs?q=search-for-something');
|
||||
rootTC.detectChanges();
|
||||
});
|
||||
}));
|
||||
}), 1000);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
@ -179,7 +179,7 @@ export function main() {
|
|||
async.done();
|
||||
});
|
||||
});
|
||||
}));
|
||||
}), 1000);
|
||||
|
||||
it('should navigate to link hrefs in presence of base href',
|
||||
inject([AsyncTestCompleter], (async) => {
|
||||
|
@ -200,7 +200,7 @@ export function main() {
|
|||
async.done();
|
||||
});
|
||||
});
|
||||
}));
|
||||
}), 1000);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
@ -63,7 +63,7 @@ export function main() {
|
|||
expect(ev['url']).toEqual('/user/btford');
|
||||
async.done();
|
||||
})
|
||||
}), 1000);
|
||||
}), 2000);
|
||||
|
||||
it('should normalize location path', () => {
|
||||
locationStrategy.internalPath = '/my/app/user/btford';
|
||||
|
|
|
@ -35,7 +35,7 @@ export function main() {
|
|||
});
|
||||
var toEmitter = bus.to(CHANNEL);
|
||||
ObservableWrapper.callNext(toEmitter, MESSAGE);
|
||||
}));
|
||||
}), 1000);
|
||||
|
||||
it("should broadcast", inject([AsyncTestCompleter], (async) => {
|
||||
const CHANNEL = "CHANNEL 1";
|
||||
|
|
Loading…
Reference in New Issue