test(ivy): add root causes for router TestBed failures (#28014)

PR Close #28014
This commit is contained in:
Marc Laval 2019-01-09 15:45:55 +01:00 committed by Andrew Kushnir
parent 29e3144269
commit 5609764886
1 changed files with 95 additions and 99 deletions

View File

@ -451,7 +451,7 @@ describe('Integration', () => {
expect(fixture.nativeElement).toHaveText('team 33 [ , right: ]'); expect(fixture.nativeElement).toHaveText('team 33 [ , right: ]');
}))); })));
fixmeIvy('unknown/maybe FW-918') fixmeIvy('FW-768: markViewDirty instruction is scheduling a tick')
.it('should work when an outlet is in an ngIf', .it('should work when an outlet is in an ngIf',
fakeAsync(inject([Router, Location], (router: Router, location: Location) => { fakeAsync(inject([Router, Location], (router: Router, location: Location) => {
const fixture = createRoot(router, RootCmp); const fixture = createRoot(router, RootCmp);
@ -468,7 +468,8 @@ describe('Integration', () => {
expect(location.path()).toEqual('/child/simple'); expect(location.path()).toEqual('/child/simple');
}))); })));
it('should work when an outlet is added/removed', fakeAsync(() => { fixmeIvy('FW-768: markViewDirty instruction is scheduling a tick')
.it('should work when an outlet is added/removed', fakeAsync(() => {
@Component({ @Component({
selector: 'someRoot', selector: 'someRoot',
template: `[<div *ngIf="cond"><router-outlet></router-outlet></div>]` template: `[<div *ngIf="cond"><router-outlet></router-outlet></div>]`
@ -498,9 +499,6 @@ describe('Integration', () => {
fixture.componentInstance.cond = true; fixture.componentInstance.cond = true;
advance(fixture); advance(fixture);
expect(fixture.nativeElement).toHaveText('[simple]'); expect(fixture.nativeElement).toHaveText('[simple]');
// TODO: remove extra tick for Ivy?
tick();
})); }));
it('should update location when navigating', fakeAsync(() => { it('should update location when navigating', fakeAsync(() => {
@ -635,7 +633,7 @@ describe('Integration', () => {
expect(fixture.nativeElement).toHaveText('team 33 [ , right: ]'); expect(fixture.nativeElement).toHaveText('team 33 [ , right: ]');
}))); })));
fixmeIvy('unknown/maybe FW-918') fixmeIvy('FW-768: markViewDirty instruction is scheduling a tick')
.it('should navigate back and forward', .it('should navigate back and forward',
fakeAsync(inject([Router, Location], (router: Router, location: Location) => { fakeAsync(inject([Router, Location], (router: Router, location: Location) => {
const fixture = createRoot(router, RootCmp); const fixture = createRoot(router, RootCmp);
@ -1008,7 +1006,7 @@ describe('Integration', () => {
]); ]);
}))); })));
fixmeIvy('unknown/maybe FW-918') fixmeIvy('FW-768: markViewDirty instruction is scheduling a tick')
.it('should handle failed navigations gracefully', .it('should handle failed navigations gracefully',
fakeAsync(inject([Router], (router: Router) => { fakeAsync(inject([Router], (router: Router) => {
const fixture = createRoot(router, RootCmp); const fixture = createRoot(router, RootCmp);
@ -2033,7 +2031,7 @@ describe('Integration', () => {
}); });
}); });
fixmeIvy('unknown/maybe FW-918') fixmeIvy('FW-768: markViewDirty instruction is scheduling a tick')
.it('works', .it('works',
fakeAsync(inject([Router, Location], (router: Router, location: Location) => { fakeAsync(inject([Router, Location], (router: Router, location: Location) => {
const fixture = createRoot(router, RootCmp); const fixture = createRoot(router, RootCmp);
@ -2056,7 +2054,7 @@ describe('Integration', () => {
beforeEach(() => { TestBed.configureTestingModule({providers: [AlwaysTrue]}); }); beforeEach(() => { TestBed.configureTestingModule({providers: [AlwaysTrue]}); });
fixmeIvy('unknown/maybe FW-918') fixmeIvy('FW-768: markViewDirty instruction is scheduling a tick')
.it('works', .it('works',
fakeAsync(inject([Router, Location], (router: Router, location: Location) => { fakeAsync(inject([Router, Location], (router: Router, location: Location) => {
const fixture = createRoot(router, RootCmp); const fixture = createRoot(router, RootCmp);
@ -3357,7 +3355,7 @@ describe('Integration', () => {
}); });
describe('route events', () => { describe('route events', () => {
fixmeIvy('unknown/maybe FW-918') fixmeIvy('FW-768: markViewDirty instruction is scheduling a tick')
.it('should fire matching (Child)ActivationStart/End events', .it('should fire matching (Child)ActivationStart/End events',
fakeAsync(inject([Router], (router: Router) => { fakeAsync(inject([Router], (router: Router) => {
const fixture = createRoot(router, RootCmp); const fixture = createRoot(router, RootCmp);
@ -4530,7 +4528,8 @@ describe('Integration', () => {
expect(simpleCmp1).not.toBe(simpleCmp2); expect(simpleCmp1).not.toBe(simpleCmp2);
}))); })));
it('should not mount the component of the previously reused route when the outlet was not instantiated at the time of route activation', fixmeIvy('FW-768: markViewDirty instruction is scheduling a tick')
.it('should not mount the component of the previously reused route when the outlet was not instantiated at the time of route activation',
fakeAsync(() => { fakeAsync(() => {
@Component({ @Component({
selector: 'root-cmp', selector: 'root-cmp',
@ -4604,9 +4603,6 @@ describe('Integration', () => {
router.navigate([{outlets: {toolpanel: 'b'}}]); router.navigate([{outlets: {toolpanel: 'b'}}]);
advance(fixture); advance(fixture);
expect(fixture).toContainComponent(Tool2Component, '(e)'); expect(fixture).toContainComponent(Tool2Component, '(e)');
// TODO: remove extra tick for Ivy?
tick();
})); }));
}); });
}); });