diff --git a/test/tests/Item.js b/test/tests/Item.js index 3f40c46b..dc1f1a1b 100644 --- a/test/tests/Item.js +++ b/test/tests/Item.js @@ -759,13 +759,30 @@ test('Item#applyMatrix', function() { test('PaperScope#settings.insertItems', function() { var insertItems = paper.settings.insertItems; paper.settings.insertItems = true; + + var path1, path2; + equals(function() { - return new Path().parent === project.activeLayer; + path1 = new Path(); + return path1.parent === project.activeLayer; }, true); paper.settings.insertItems = false; + equals(function() { - return new Path().parent === null; + path2 = new Path(); + return path2.parent === null; }, true); + + equals(function() { + return project.activeLayer.children.length; + }, 1); + + project.activeLayer.addChild(path2); + + equals(function() { + return project.activeLayer.children.length; + }, 2); + paper.settings.insertItems = insertItems; }); diff --git a/test/tests/Layer.js b/test/tests/Layer.js index ff1330b5..92b43678 100644 --- a/test/tests/Layer.js +++ b/test/tests/Layer.js @@ -32,23 +32,23 @@ test('previousSibling / nextSibling', function() { return secondLayer.children.length; }, 2); equals(function() { - return thirdLayer.nextSibling == path; + return thirdLayer.nextSibling === path; }, true); secondLayer.addChild(thirdLayer); equals(function() { - return thirdLayer.nextSibling == null; + return thirdLayer.nextSibling; + }, null); + equals(function() { + return thirdLayer.previousSibling === path; }, true); equals(function() { - return thirdLayer.previousSibling == path; - }, true); - equals(function() { - return project.layers.length == 2; - }, true); + return project.layers.length; + }, 2); firstLayer.addChild(secondLayer); equals(function() { - return project.layers.length == 1; - }, true); + return project.layers.length; + }, 1); }); test('insertAbove / insertBelow', function() {