fix(router): ensuring MatchedUrl pass query params

This commit is contained in:
kurt
2016-03-31 13:04:47 +09:00
committed by Misko Hevery
parent 3ac2821a1b
commit 7d853dd9ad
2 changed files with 17 additions and 1 deletions

View File

@ -296,6 +296,22 @@ export function main() {
});
}));
it('should match query params on the root component even when the next URL segment is null',
inject([AsyncTestCompleter], (async) => {
registry.config(RootHostCmp,
new Route({path: '/first/...', component: SingleSlashChildCmp}));
registry.recognize('/first?comments=all', [])
.then((instruction) => {
expect(instruction.component.componentType).toBe(SingleSlashChildCmp);
expect(instruction.component.params).toEqual({'comments': 'all'});
expect(instruction.child.component.componentType).toBe(DummyCmpB);
expect(instruction.child.component.params).toEqual({});
async.done();
});
}));
it('should generate URLs with matrix and query params', () => {
registry.config(
RootHostCmp,