diff --git a/test/lib/helpers.js b/test/lib/helpers.js index 42b0e001..822a81fd 100644 --- a/test/lib/helpers.js +++ b/test/lib/helpers.js @@ -103,24 +103,6 @@ function compareGradientColors(gradientColor, gradientColor2, checkIdentity) { }, true); } -function cloneAndCompare(item) { - var copy = item.clone(); - equals(function() { - return item.parent == copy.parent; - }, true); - equals(function() { - return item.nextSibling == copy; - }, true); - if (item.name) { - equals(function() { - return copy.parent.children[copy.name] == copy; - }, true); - } - compareItems(item, copy, true); - // Remove the cloned item to restore the document: - copy.remove(); -} - function comparePathStyles(style, style2, checkIdentity) { if (checkIdentity) { equals(function() { diff --git a/test/tests/Item_Cloning.js b/test/tests/Item_Cloning.js index 28e5e798..e8073be1 100644 --- a/test/tests/Item_Cloning.js +++ b/test/tests/Item_Cloning.js @@ -1,3 +1,21 @@ +function cloneAndCompare(item) { + var copy = item.clone(); + equals(function() { + return item.parent == copy.parent; + }, true); + equals(function() { + return item.nextSibling == copy; + }, true); + if (item.name) { + equals(function() { + return copy.parent.children[copy.name] == copy; + }, true); + } + compareItems(item, copy, true); + // Remove the cloned item to restore the document: + copy.remove(); +} + test('Path#clone()', function() { var proj = paper.project; var path = new Path([10, 20], [30, 40]);