mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 10:48:38 -05:00
Define tests for Item#remove()
This commit is contained in:
parent
6450430b68
commit
8414607cee
1 changed files with 20 additions and 0 deletions
|
@ -134,6 +134,26 @@ test('item.parent / item.isChild / item.isParent / item.layer', function() {
|
||||||
}, true);
|
}, 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() {
|
test('item.lastChild / item.firstChild', function() {
|
||||||
var project = paper.project;
|
var project = paper.project;
|
||||||
var path = new Path();
|
var path = new Path();
|
||||||
|
|
Loading…
Reference in a new issue