mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-06 04:42:15 -05:00
Add failing test where after cloning a selected item, it isn't added to the Project#selectedItems array.
This commit is contained in:
parent
3a9da3c0a0
commit
4c306b9997
1 changed files with 30 additions and 0 deletions
|
@ -168,6 +168,36 @@ test('After simplifying a path using #simplify(), the path should stay fullySele
|
||||||
}, true);
|
}, 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() {
|
test('After simplifying a path using #simplify(), the path should stay selected', function() {
|
||||||
var path = new Path();
|
var path = new Path();
|
||||||
for (var i = 0; i < 30; i++) {
|
for (var i = 0; i < 30; i++) {
|
||||||
|
|
Loading…
Reference in a new issue