fix(router): stringify positional parameters when using routerLink

This commit is contained in:
vsavkin
2016-06-16 14:45:16 -07:00
parent cf4a9236b9
commit f8e8d22e4e
2 changed files with 11 additions and 1 deletions

View File

@ -20,6 +20,15 @@ describe('createUrlTree', () => {
expect(serializer.serialize(t)).toEqual("/one/11/two/22");
});
it("should stringify positional parameters", () => {
const p = serializer.parse("/a/b");
const t = createRoot(p, ["/one", 11]);
const params = t.root.children[PRIMARY_OUTLET].pathsWithParams;
expect(params[0].path).toEqual("one");
expect(params[1].path).toEqual("11");
});
it("should preserve secondary segments", () => {
const p = serializer.parse("/a/11/b(right:c)");
const t = createRoot(p, ["/a", 11, 'd']);