Skip to content

Commit 2ae3614

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 604cdb7 commit 2ae3614

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
@@ -2983,22 +2983,6 @@ describe('Integration', () => {
29832983
expect(history[history.length - 1].state)
29842984
.toEqual({foo: 'bar', navigationId: history.length});
29852985
})));
2986-
2987-
2988-
it('can redirect from componentless named outlets', fakeAsync(() => {
2989-
const router = TestBed.inject(Router);
2990-
const fixture = createRoot(router, RootCmp);
2991-
2992-
router.resetConfig([
2993-
{path: 'main', outlet: 'aux', component: BlankCmp},
2994-
{path: '', pathMatch: 'full', outlet: 'aux', redirectTo: 'main'},
2995-
]);
2996-
2997-
router.navigateByUrl('');
2998-
advance(fixture);
2999-
3000-
expect(TestBed.inject(Location).path()).toEqual('/(aux:main)');
3001-
}));
30022986
});
30032987

30042988
it('should set href on area elements', fakeAsync(() => {
@@ -3035,6 +3019,21 @@ describe('Integration', () => {
30353019
expect(location.path()).toEqual('/team/22');
30363020
})));
30373021

3022+
it('can redirect from componentless named outlets', fakeAsync(() => {
3023+
const router = TestBed.inject(Router);
3024+
const fixture = createRoot(router, RootCmp);
3025+
3026+
router.resetConfig([
3027+
{path: 'main', outlet: 'aux', component: BlankCmp},
3028+
{path: '', pathMatch: 'full', outlet: 'aux', redirectTo: 'main'},
3029+
]);
3030+
3031+
router.navigateByUrl('');
3032+
advance(fixture);
3033+
3034+
expect(TestBed.inject(Location).path()).toEqual('/(aux:main)');
3035+
}));
3036+
30383037
it('should update Navigation object after redirects are applied',
30393038
fakeAsync(inject([Router, Location], (router: Router, location: Location) => {
30403039
const fixture = createRoot(router, RootCmp);

0 commit comments

Comments
 (0)