From 2ae36142a6a2ea55e650c691c583780de2da498c Mon Sep 17 00:00:00 2001 From: Andrew Scott Date: Tue, 8 Nov 2022 10:11:08 -0800 Subject: [PATCH] test(router): Move test for redirect under correct describe block (#47993) This moves a redirect test to be grouped with other redirect tests. PR Close #47993 --- packages/router/test/integration.spec.ts | 31 ++++++++++++------------ 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/packages/router/test/integration.spec.ts b/packages/router/test/integration.spec.ts index b7aefa2ca33..e7b57a3c33b 100644 --- a/packages/router/test/integration.spec.ts +++ b/packages/router/test/integration.spec.ts @@ -2983,22 +2983,6 @@ describe('Integration', () => { expect(history[history.length - 1].state) .toEqual({foo: 'bar', navigationId: history.length}); }))); - - - it('can redirect from componentless named outlets', fakeAsync(() => { - const router = TestBed.inject(Router); - const fixture = createRoot(router, RootCmp); - - router.resetConfig([ - {path: 'main', outlet: 'aux', component: BlankCmp}, - {path: '', pathMatch: 'full', outlet: 'aux', redirectTo: 'main'}, - ]); - - router.navigateByUrl(''); - advance(fixture); - - expect(TestBed.inject(Location).path()).toEqual('/(aux:main)'); - })); }); it('should set href on area elements', fakeAsync(() => { @@ -3035,6 +3019,21 @@ describe('Integration', () => { expect(location.path()).toEqual('/team/22'); }))); + it('can redirect from componentless named outlets', fakeAsync(() => { + const router = TestBed.inject(Router); + const fixture = createRoot(router, RootCmp); + + router.resetConfig([ + {path: 'main', outlet: 'aux', component: BlankCmp}, + {path: '', pathMatch: 'full', outlet: 'aux', redirectTo: 'main'}, + ]); + + router.navigateByUrl(''); + advance(fixture); + + expect(TestBed.inject(Location).path()).toEqual('/(aux:main)'); + })); + it('should update Navigation object after redirects are applied', fakeAsync(inject([Router, Location], (router: Router, location: Location) => { const fixture = createRoot(router, RootCmp);