test(router): add integration test for async routes with children

This commit is contained in:
Brian Ford 2015-09-11 10:07:09 -07:00
parent f6cc573687
commit 3c13f5fd4b
1 changed files with 16 additions and 0 deletions

View File

@ -114,6 +114,18 @@ export function main() {
}));
it('should navigate to child routes of async routes', inject([AsyncTestCompleter], (async) => {
compile('outer { <router-outlet></router-outlet> }')
.then((_) => rtr.config([new AsyncRoute({path: '/a/...', loader: parentLoader})]))
.then((_) => rtr.navigate('/a/b'))
.then((_) => {
rootTC.detectChanges();
expect(rootTC.nativeElement).toHaveText('outer { inner { hello } }');
async.done();
});
}));
it('should recognize and apply redirects',
inject([AsyncTestCompleter, Location], (async, location) => {
compile()
@ -286,6 +298,10 @@ class UserCmp {
}
function parentLoader() {
return PromiseWrapper.resolve(ParentCmp);
}
@Component({selector: 'parent-cmp'})
@View({template: "inner { <router-outlet></router-outlet> }", directives: [RouterOutlet]})
@RouteConfig([new Route({path: '/b', component: HelloCmp})])