mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
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
This commit is contained in:
committed by
Andrew Kushnir
parent
604cdb7307
commit
2ae36142a6
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user