test(router): Ensure change detection runs after navigation (#47629)

Components are not fully rendered until change detection runs.

PR Close #47629
This commit is contained in:
Andrew Scott 2022-10-04 16:06:40 -07:00 committed by Andrew Kushnir
parent da58801f95
commit 2f0761000f
2 changed files with 3 additions and 1 deletions

View file

@ -33,7 +33,7 @@
"cli-hello-world-lazy": {
"uncompressed": {
"runtime": 2835,
"main": 225808,
"main": 226404,
"polyfills": 33842,
"src_app_lazy_lazy_routes_ts": 487
}

View file

@ -350,6 +350,7 @@ describe('standalone in Router API', () => {
const root = TestBed.createComponent(RootCmp);
await TestBed.inject(Router).navigateByUrl('/home');
root.detectChanges();
expect(root.nativeElement.innerHTML).toContain('default exported');
});
@ -364,6 +365,7 @@ describe('standalone in Router API', () => {
const root = TestBed.createComponent(RootCmp);
await TestBed.inject(Router).navigateByUrl('/home');
root.detectChanges();
expect(root.nativeElement.innerHTML).toContain('default exported');
});