test(router): add missing tests for the url parser
This commit is contained in:
parent
8bc40d3f4d
commit
c0b7bae9d3
|
@ -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');
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue