Define tests for Item#remove()

This commit is contained in:
Jürg Lehni 2014-09-27 22:49:32 +02:00
parent 6450430b68
commit 8414607cee

View file

@ -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();