diff --git a/modules/angular2/test/router/url_parser_spec.ts b/modules/angular2/test/router/url_parser_spec.ts index 2fd8b6ef2d..12fd02c25c 100644 --- a/modules/angular2/test/router/url_parser_spec.ts +++ b/modules/angular2/test/router/url_parser_spec.ts @@ -29,6 +29,11 @@ export function main() { expect(url.toString()).toEqual('hello/there'); }); + it('should parse an empty URL', () => { + var url = urlParser.parse(''); + expect(url.toString()).toEqual(''); + }); + it('should work with a single aux route', () => { var url = urlParser.parse('hello/there(a)'); expect(url.toString()).toEqual('hello/there(a)'); @@ -79,6 +84,11 @@ export function main() { expect(url.toString()).toEqual('hello/there;hi'); }); + it('should parse a URL with just a query param', () => { + var url = urlParser.parse('?name=bob'); + expect(url.toString()).toEqual('?name=bob'); + }); + it('should parse a key-value query param', () => { var url = urlParser.parse('hello/friend?name=bob'); expect(url.toString()).toEqual('hello/friend?name=bob'); @@ -90,7 +100,7 @@ export function main() { expect(url.toString()).toEqual('hello/there?greeting=hi&whats=up'); }); - it('should parse a key-only matrix param', () => { + it('should parse a key-only query param', () => { var url = urlParser.parse('hello/there?hi'); expect(url.toString()).toEqual('hello/there?hi'); });