Skip to content

Commit

Permalink
test(router): Move test for redirect under correct describe block (#4…
Browse files Browse the repository at this point in the history
…7993)

This moves a redirect test to be grouped with other redirect tests.

PR Close #47993
  • Loading branch information
atscott authored and AndrewKushnir committed Nov 8, 2022
1 parent c3bc035 commit 28efb06
Showing 1 changed file with 15 additions and 16 deletions.
31 changes: 15 additions & 16 deletions packages/router/test/integration.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3006,22 +3006,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(() => {
Expand Down Expand Up @@ -3058,6 +3042,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);
Expand Down

0 comments on commit 28efb06

Please sign in to comment.