From b6ec22de6bca00287d00a59acbd84c036688364c Mon Sep 17 00:00:00 2001 From: vsavkin Date: Tue, 14 Jun 2016 15:29:42 -0700 Subject: [PATCH] test(router): test empty url with global redirect --- modules/@angular/router/test/apply_redirects.spec.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/modules/@angular/router/test/apply_redirects.spec.ts b/modules/@angular/router/test/apply_redirects.spec.ts index aea85b2a23..608b882cac 100644 --- a/modules/@angular/router/test/apply_redirects.spec.ts +++ b/modules/@angular/router/test/apply_redirects.spec.ts @@ -90,6 +90,17 @@ describe('applyRedirects', () => { }); }); + it("should redirect empty path (global redirect)", () => { + checkRedirect([ + {path: 'a', component: ComponentA, children: [ + {path: 'b', component: ComponentB}, + ]}, + {path: '', redirectTo: '/a/b'} + ], "", t => { + compareTrees(t, tree('a/b')); + }); + }); + xit("should support nested redirects", () => { checkRedirect([ {path: 'a', component: ComponentA, children: [