test(angular): add tests for ngOnInit

This commit is contained in:
Manu Mtz.-Almeida
2018-12-05 21:22:26 +01:00
committed by Manu MA
parent c8d9685bc9
commit 7698c31790
8 changed files with 30 additions and 9 deletions

View File

@ -19,11 +19,11 @@ export class StackController {
private zone: NgZone,
) {}
createView(enteringRef: ComponentRef<any>, route: ActivatedRoute): RouteView {
createView(enteringRef: ComponentRef<any>, activatedRoute: ActivatedRoute): RouteView {
return {
ref: enteringRef,
element: (enteringRef && enteringRef.location && enteringRef.location.nativeElement) as HTMLElement,
url: this.getUrl(route)
url: this.getUrl(activatedRoute)
};
}
@ -134,6 +134,7 @@ export class StackController {
}
if (enteringView) {
enteringView.ref.changeDetectorRef.reattach();
enteringView.ref.changeDetectorRef.markForCheck();
}
const enteringEl = enteringView ? enteringView.element : undefined;
const leavingEl = leavingView ? leavingView.element : undefined;