Fix Layer#insertAbove / insertBelow test.

This commit is contained in:
Jürg Lehni 2013-07-21 16:44:30 -07:00
parent 16735e23af
commit 98697eb003
2 changed files with 4 additions and 2 deletions

View file

@ -16,6 +16,7 @@ function cloneAndCompare(item) {
return item.parent == copy.parent;
}, true);
equals(function() {
// Cloned items appear above the original.
return item.nextSibling == copy;
}, true);
if (item.name) {

View file

@ -76,10 +76,11 @@ test('insertAbove / insertBelow', function() {
var path = new Path();
firstLayer.addChild(path);
// move the layer above the path, inside the firstLayer:
// move the layer above the path, inside the firstLayer.
// 'Above' means visually appearing on top, thus with a larger index.
secondLayer.insertAbove(path);
equals(function() {
return secondLayer.nextSibling == path;
return path.nextSibling == secondLayer;
}, true);
equals(function() {
return secondLayer.parent == firstLayer;