From 5e495a3a6eefa0d7ea451cebe73385a03765e70b Mon Sep 17 00:00:00 2001 From: Jonathan Puckey Date: Mon, 20 Jun 2011 17:00:41 +0200 Subject: [PATCH] Add tests for selection state after removing all segments of a path. --- test/tests/Path.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/test/tests/Path.js b/test/tests/Path.js index 1463c865..9dd17ba9 100644 --- a/test/tests/Path.js +++ b/test/tests/Path.js @@ -129,6 +129,25 @@ test('After setting Path#fullySelected=true on an empty path, subsequent segment }, true); }); +test('After removing all segments of a fully selected path, it should still be fully selected.', function() { + var path = new Path([10, 20], [30, 40]); + path.fullySelected = true; + path.removeSegments(); + equals(function() { + return path.fullySelected; + }, true); +}); + +test('After removing all segments of a selected path, it should still be selected.', function() { + var path = new Path([10, 20], [30, 40]); + path.selected = true; + path.removeSegments(); + equals(function() { + return path.selected; + }, true); +}); + + test('After simplifying a path using #pointToCurves(), the path should stay fullySelected', function() { var path = new Path(); for (var i = 0; i < 30; i++) {