From 343dac35b1aacb13d71f8aebf2616d24bd2a6f52 Mon Sep 17 00:00:00 2001 From: Jonathan Puckey Date: Sun, 3 Mar 2013 20:08:49 +0100 Subject: [PATCH] Add tests for Item#sendToBack & Item#bringToFront. --- test/tests/Item.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/test/tests/Item.js b/test/tests/Item.js index 0376bd17..1481d641 100644 --- a/test/tests/Item.js +++ b/test/tests/Item.js @@ -143,6 +143,26 @@ test('insertBelow(item)', function() { }, true); }); +test('sendToBack()', function() { + var project = paper.project; + var firstPath = new Path(); + var secondPath = new Path(); + secondPath.sendToBack(); + equals(function() { + return secondPath.index == 0; + }, true); +}); + +test('bringToFront()', function() { + var project = paper.project; + var firstPath = new Path(); + var secondPath = new Path(); + firstPath.bringToFront(); + equals(function() { + return firstPath.index == 1; + }, true); +}); + test('isDescendant(item) / isAncestor(item)', function() { var project = paper.project; var path = new Path();