From 9604e2bd4f252a3b2b5582f3d84bda324a23cfce Mon Sep 17 00:00:00 2001 From: Jonathan Puckey Date: Sat, 6 Oct 2012 11:15:52 +0200 Subject: [PATCH] Add failing test of issue with Group#addChildren as reported in #119 --- test/tests/Group.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/test/tests/Group.js b/test/tests/Group.js index 589fe81b..413d134a 100644 --- a/test/tests/Group.js +++ b/test/tests/Group.js @@ -52,4 +52,22 @@ test('Group bounds', function() { group.rotate(20, new Point(50, 50)); compareRectangles(group.bounds, { x: 39.70692, y: 114.99196, width: 170.00412, height: 180.22401 }, 'rotated group.bounds'); compareRectangles(group.strokeBounds, { x: 37.20692, y: 112.49196, width: 175.00412, height: 185.22401 }, 'rotated group.strokeBounds'); +}); + +test('group.addChildren(otherGroup.children)', function() { + var group = new Group(); + group.addChild(new Path()); + group.addChild(new Path()); + equals(function() { + return group.children.length; + }, 2); + + var secondGroup = new Group(); + secondGroup.addChildren(group.children); + equals(function() { + return secondGroup.children.length; + }, 2); + equals(function() { + return group.children.length; + }, 0); }); \ No newline at end of file