From 4c306b9997e7a070b108ccd79ca7906fd527de25 Mon Sep 17 00:00:00 2001 From: Jonathan Puckey Date: Tue, 21 Jun 2011 01:31:07 +0200 Subject: [PATCH] Add failing test where after cloning a selected item, it isn't added to the Project#selectedItems array. --- test/tests/Path.js | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/test/tests/Path.js b/test/tests/Path.js index 69e37ca2..803936d8 100644 --- a/test/tests/Path.js +++ b/test/tests/Path.js @@ -168,6 +168,36 @@ test('After simplifying a path using #simplify(), the path should stay fullySele }, true); }); +test('After simplifying a path using #simplify(), the path should stay fullySelected', function() { + var path = new Path(); + for (var i = 0; i < 30; i++) { + path.add(i * 10, 10); + }; + path.fullySelected = true; + equals(function() { + return path.selected; + }, true); + + path.simplify(); + + equals(function() { + return path.selected; + }, true); + equals(function() { + return path.fullySelected; + }, true); +}); + +test('After cloning a selected item, it should be added to the Project#selectedItems array', function() { + var path = new Path.Circle(new Size(80, 50), 35); + path.selected = true; + var copy = path.clone(); + + equals(function() { + return paper.project.selectedItems.length + }, 2); +}); + test('After simplifying a path using #simplify(), the path should stay selected', function() { var path = new Path(); for (var i = 0; i < 30; i++) {