From 56f8c95ee9499a4ac78ca4a9871e8e43c512a31f Mon Sep 17 00:00:00 2001 From: vsavkin Date: Mon, 6 Jun 2016 18:27:36 -0700 Subject: [PATCH] tests(router): add tests verifying that updating secondary segments using router link works --- .../@angular/router/test/create_url_tree.spec.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/modules/@angular/router/test/create_url_tree.spec.ts b/modules/@angular/router/test/create_url_tree.spec.ts index 8c1575651b..f58984f888 100644 --- a/modules/@angular/router/test/create_url_tree.spec.ts +++ b/modules/@angular/router/test/create_url_tree.spec.ts @@ -26,6 +26,19 @@ describe('createUrlTree', () => { expect(serializer.serialize(t)).toEqual("/a/11/d(right:c)"); }); + it("should support updating secondary segments", () => { + const p = serializer.parse("/a(right:b)"); + const t = create(p.root, p, ["right:c", 11, 'd']); + expect(t.children(t.root)[1].outlet).toEqual("right"); + expect(serializer.serialize(t)).toEqual("/a(right:c/11/d)"); + }); + + it("should support updating secondary segments (nested case)", () => { + const p = serializer.parse("/a/b(right:c)"); + const t = create(p.root, p, ["a", "right:d", 11, 'e']); + expect(serializer.serialize(t)).toEqual("/a/b(right:d/11/e)"); + }); + it('should update matrix parameters', () => { const p = serializer.parse("/a;aa=11"); const t = create(p.root, p, ["/a", {aa: 22, bb: 33}]);