From 8414607ceec709c1ef103a56ef6852e9301f5510 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Sat, 27 Sep 2014 22:49:32 +0200 Subject: [PATCH] Define tests for Item#remove() --- test/tests/Item.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/test/tests/Item.js b/test/tests/Item.js index 86f24051..40112676 100644 --- a/test/tests/Item.js +++ b/test/tests/Item.js @@ -134,6 +134,26 @@ test('item.parent / item.isChild / item.isParent / item.layer', function() { }, true); }); +test('item.remove()', function() { + var project = paper.project; + var path = new Path(); + equals(function() { + return project.activeLayer.children.length; + }, 1); + path.remove(); + equals(function() { + return project.activeLayer.children.length; + }, 0); + var group = new Group(path); + equals(function() { + return group.children.length; + }, 1); + path.remove(); + equals(function() { + return group.children.length; + }, 0); +}); + test('item.lastChild / item.firstChild', function() { var project = paper.project; var path = new Path();