Skip to content

Commit 28efb06

Browse files
atscottAndrewKushnir
authored andcommitted
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
1 parent c3bc035 commit 28efb06

File tree

1 file changed

+15
-16
lines changed

1 file changed

+15
-16
lines changed

packages/router/test/integration.spec.ts

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3006,22 +3006,6 @@ describe('Integration', () => {
30063006
expect(history[history.length - 1].state)
30073007
.toEqual({foo: 'bar', navigationId: history.length});
30083008
})));
3009-
3010-
3011-
it('can redirect from componentless named outlets', fakeAsync(() => {
3012-
const router = TestBed.inject(Router);
3013-
const fixture = createRoot(router, RootCmp);
3014-
3015-
router.resetConfig([
3016-
{path: 'main', outlet: 'aux', component: BlankCmp},
3017-
{path: '', pathMatch: 'full', outlet: 'aux', redirectTo: 'main'},
3018-
]);
3019-
3020-
router.navigateByUrl('');
3021-
advance(fixture);
3022-
3023-
expect(TestBed.inject(Location).path()).toEqual('/(aux:main)');
3024-
}));
30253009
});
30263010

30273011
it('should set href on area elements', fakeAsync(() => {
@@ -3058,6 +3042,21 @@ describe('Integration', () => {
30583042
expect(location.path()).toEqual('/team/22');
30593043
})));
30603044

3045+
it('can redirect from componentless named outlets', fakeAsync(() => {
3046+
const router = TestBed.inject(Router);
3047+
const fixture = createRoot(router, RootCmp);
3048+
3049+
router.resetConfig([
3050+
{path: 'main', outlet: 'aux', component: BlankCmp},
3051+
{path: '', pathMatch: 'full', outlet: 'aux', redirectTo: 'main'},
3052+
]);
3053+
3054+
router.navigateByUrl('');
3055+
advance(fixture);
3056+
3057+
expect(TestBed.inject(Location).path()).toEqual('/(aux:main)');
3058+
}));
3059+
30613060
it('should update Navigation object after redirects are applied',
30623061
fakeAsync(inject([Router, Location], (router: Router, location: Location) => {
30633062
const fixture = createRoot(router, RootCmp);

0 commit comments

Comments
 (0)