diff --git a/test/tests/Group.js b/test/tests/Group.js index 04748dd1..e4a0b246 100644 --- a/test/tests/Group.js +++ b/test/tests/Group.js @@ -40,6 +40,19 @@ test('new Group([item])', function() { }, true); }); +test('new Group({children:[item]})', function() { + var path = new Path(); + var group = new Group({ + children: [path] + }); + equals(function() { + return paper.project.activeLayer.children.length; + }, 1); + equals(function() { + return group.children[0] == path; + }, true); +}); + test('Group bounds', function() { paper.project.currentStyle = { strokeWidth: 5, diff --git a/test/tests/Rectangle.js b/test/tests/Rectangle.js index 51113038..aaf842a4 100644 --- a/test/tests/Rectangle.js +++ b/test/tests/Rectangle.js @@ -16,11 +16,21 @@ test('new Rectangle(new Point(10, 20), new Size(30, 40));', function() { equals(rect.toString(), '{ x: 10, y: 20, width: 30, height: 40 }'); }); +test('new Rectangle({ point: new Point(10, 20), size: new Size(30, 40)});', function() { + var rect = new Rectangle({ point: new Point(10, 20), size: new Size(30, 40)}); + equals(rect.toString(), '{ x: 10, y: 20, width: 30, height: 40 }'); +}); + test('new Rectangle([10, 20], [30, 40]);', function() { var rect = new Rectangle([10, 20], [30, 40]); equals(rect.toString(), '{ x: 10, y: 20, width: 30, height: 40 }'); }); +test('new Rectangle({from: [10, 20], to: [30, 40]});', function() { + var rect = new Rectangle({from: [10, 20], to: [30, 40]}); + equals(rect.toString(), '{ x: 10, y: 20, width: 30, height: 40 }'); +}); + test('new Rectangle(new Point(10, 20), new Point(30, 40));', function() { var rect = new Rectangle(new Point(10, 20), new Point(30, 40)); equals(rect.toString(), '{ x: 10, y: 20, width: 20, height: 20 }');