fix(router): add support for query params with mulitple values

closes #11373
This commit is contained in:
Andy Howell
2016-09-06 12:39:53 +01:00
committed by Victor Berchet
parent 03d9de33a1
commit e4d5a5f003
2 changed files with 30 additions and 4 deletions

View File

@ -160,6 +160,11 @@ describe('url serializer', () => {
expect(url.serialize(tree)).toEqual('/one?a=');
});
it('should handle multiple query params of the same name into an array', () => {
const tree = url.parse('/one?a=foo&a=bar&a=swaz');
expect(tree.queryParams).toEqual({a: ['foo', 'bar', 'swaz']});
});
it('should parse fragment', () => {
const tree = url.parse('/one#two');
expect(tree.fragment).toEqual('two');