test(ivy): add root cause analysis for failing router tests (#27792)

PR Close #27792
This commit is contained in:
Marc Laval 2018-12-21 11:25:55 +01:00 committed by Matias Niemelä
parent 50a91ba28c
commit 5da55d6246
1 changed files with 45 additions and 45 deletions

View File

@ -4074,27 +4074,27 @@ describe('Integration', () => {
}); });
}); });
fixmeIvy('unknown').it( fixmeIvy('FW-887: JIT: compilation of NgModule')
'should use the injector of the lazily-loaded configuration', .it('should use the injector of the lazily-loaded configuration',
fakeAsync(inject( fakeAsync(inject(
[Router, Location, NgModuleFactoryLoader], [Router, Location, NgModuleFactoryLoader],
(router: Router, location: Location, loader: SpyNgModuleFactoryLoader) => { (router: Router, location: Location, loader: SpyNgModuleFactoryLoader) => {
loader.stubbedModules = {expected: LoadedModule}; loader.stubbedModules = {expected: LoadedModule};
const fixture = createRoot(router, RootCmp); const fixture = createRoot(router, RootCmp);
router.resetConfig([{ router.resetConfig([{
path: 'eager-parent', path: 'eager-parent',
component: EagerParentComponent, component: EagerParentComponent,
children: [{path: 'lazy', loadChildren: 'expected'}] children: [{path: 'lazy', loadChildren: 'expected'}]
}]); }]);
router.navigateByUrl('/eager-parent/lazy/lazy-parent/lazy-child'); router.navigateByUrl('/eager-parent/lazy/lazy-parent/lazy-child');
advance(fixture); advance(fixture);
expect(location.path()).toEqual('/eager-parent/lazy/lazy-parent/lazy-child'); expect(location.path()).toEqual('/eager-parent/lazy/lazy-parent/lazy-child');
expect(fixture.nativeElement).toHaveText('eager-parent lazy-parent lazy-child'); expect(fixture.nativeElement).toHaveText('eager-parent lazy-parent lazy-child');
}))); })));
}); });
it('works when given a callback', it('works when given a callback',
@ -4417,43 +4417,43 @@ describe('Integration', () => {
class LazyLoadedModule { class LazyLoadedModule {
} }
fixmeIvy('unknown').it( fixmeIvy('FW-887: JIT: compilation of NgModule')
'should not ignore empty path when in legacy mode', .it('should not ignore empty path when in legacy mode',
fakeAsync(inject( fakeAsync(inject(
[Router, NgModuleFactoryLoader], [Router, NgModuleFactoryLoader],
(router: Router, loader: SpyNgModuleFactoryLoader) => { (router: Router, loader: SpyNgModuleFactoryLoader) => {
router.relativeLinkResolution = 'legacy'; router.relativeLinkResolution = 'legacy';
loader.stubbedModules = {expected: LazyLoadedModule}; loader.stubbedModules = {expected: LazyLoadedModule};
const fixture = createRoot(router, RootCmp); const fixture = createRoot(router, RootCmp);
router.resetConfig([{path: 'lazy', loadChildren: 'expected'}]); router.resetConfig([{path: 'lazy', loadChildren: 'expected'}]);
router.navigateByUrl('/lazy/foo/bar'); router.navigateByUrl('/lazy/foo/bar');
advance(fixture); advance(fixture);
const link = fixture.nativeElement.querySelector('a'); const link = fixture.nativeElement.querySelector('a');
expect(link.getAttribute('href')).toEqual('/lazy/foo/bar/simple'); expect(link.getAttribute('href')).toEqual('/lazy/foo/bar/simple');
}))); })));
fixmeIvy('unknown').it( fixmeIvy('FW-887: JIT: compilation of NgModule')
'should ignore empty path when in corrected mode', .it('should ignore empty path when in corrected mode',
fakeAsync(inject( fakeAsync(inject(
[Router, NgModuleFactoryLoader], [Router, NgModuleFactoryLoader],
(router: Router, loader: SpyNgModuleFactoryLoader) => { (router: Router, loader: SpyNgModuleFactoryLoader) => {
router.relativeLinkResolution = 'corrected'; router.relativeLinkResolution = 'corrected';
loader.stubbedModules = {expected: LazyLoadedModule}; loader.stubbedModules = {expected: LazyLoadedModule};
const fixture = createRoot(router, RootCmp); const fixture = createRoot(router, RootCmp);
router.resetConfig([{path: 'lazy', loadChildren: 'expected'}]); router.resetConfig([{path: 'lazy', loadChildren: 'expected'}]);
router.navigateByUrl('/lazy/foo/bar'); router.navigateByUrl('/lazy/foo/bar');
advance(fixture); advance(fixture);
const link = fixture.nativeElement.querySelector('a'); const link = fixture.nativeElement.querySelector('a');
expect(link.getAttribute('href')).toEqual('/lazy/foo/simple'); expect(link.getAttribute('href')).toEqual('/lazy/foo/simple');
}))); })));
}); });
}); });