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; return item.parent == copy.parent;
}, true); }, true);
equals(function() { equals(function() {
// Cloned items appear above the original.
return item.nextSibling == copy; return item.nextSibling == copy;
}, true); }, true);
if (item.name) { if (item.name) {

View file

@ -76,10 +76,11 @@ test('insertAbove / insertBelow', function() {
var path = new Path(); var path = new Path();
firstLayer.addChild(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); secondLayer.insertAbove(path);
equals(function() { equals(function() {
return secondLayer.nextSibling == path; return path.nextSibling == secondLayer;
}, true); }, true);
equals(function() { equals(function() {
return secondLayer.parent == firstLayer; return secondLayer.parent == firstLayer;