From 506a146cc0163aad9ba39ec7562a0bd629b9b585 Mon Sep 17 00:00:00 2001 From: Jonathan Puckey Date: Thu, 1 Mar 2012 16:24:26 +0100 Subject: [PATCH] Add failing test for group bounds when the group contains a group with no children. --- test/tests/Item_Bounds.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/tests/Item_Bounds.js b/test/tests/Item_Bounds.js index 250aa49b..0ffefd99 100644 --- a/test/tests/Item_Bounds.js +++ b/test/tests/Item_Bounds.js @@ -42,3 +42,12 @@ test('item.bounds caching', function() { }, 2); compareRectangles(group.bounds, { x: 50, y: 50, width: 125, height: 125 }, 'group.bounds with circle'); }); + +test('group.bounds when group contains empty group', function() { + var group = new Group(); + var rectangle = new Path.Rectangle(new Point(75, 75), new Point(175, 175)); + group.addChild(rectangle); + compareRectangles(group.bounds, { x: 75, y: 75, width: 100, height: 100 }, 'group.bounds without empty group'); + group.addChild(new Group()); + compareRectangles(group.bounds, { x: 75, y: 75, width: 100, height: 100 }, 'group.bounds with empty group'); +}); \ No newline at end of file