Skip to content

Commit 5e495a3

Browse files
committed
Add tests for selection state after removing all segments of a path.
1 parent 1ae2a4b commit 5e495a3

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

test/tests/Path.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,25 @@ test('After setting Path#fullySelected=true on an empty path, subsequent segment
129129
}, true);
130130
});
131131

132+
test('After removing all segments of a fully selected path, it should still be fully selected.', function() {
133+
var path = new Path([10, 20], [30, 40]);
134+
path.fullySelected = true;
135+
path.removeSegments();
136+
equals(function() {
137+
return path.fullySelected;
138+
}, true);
139+
});
140+
141+
test('After removing all segments of a selected path, it should still be selected.', function() {
142+
var path = new Path([10, 20], [30, 40]);
143+
path.selected = true;
144+
path.removeSegments();
145+
equals(function() {
146+
return path.selected;
147+
}, true);
148+
});
149+
150+
132151
test('After simplifying a path using #pointToCurves(), the path should stay fullySelected', function() {
133152
var path = new Path();
134153
for (var i = 0; i < 30; i++) {

0 commit comments

Comments
 (0)