mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -05:00
Add tests for Symbol#place
This commit is contained in:
parent
7abdce4f9c
commit
9cb362d389
1 changed files with 27 additions and 1 deletions
|
@ -37,4 +37,30 @@ test('Symbol definition selection', function() {
|
|||
equals(function() {
|
||||
return paper.project.selectedItems.length == 0;
|
||||
}, true);
|
||||
});
|
||||
});
|
||||
|
||||
test('Symbol#place()', function() {
|
||||
var path = new Path.Circle([50, 50], 50);
|
||||
var symbol = new Symbol(path);
|
||||
var placedSymbol = symbol.place();
|
||||
equals(function() {
|
||||
return placedSymbol.parent == paper.project.activeLayer;
|
||||
}, true);
|
||||
|
||||
equals(function() {
|
||||
return placedSymbol.symbol == symbol;
|
||||
}, true);
|
||||
|
||||
equals(function() {
|
||||
return placedSymbol.position.toString();
|
||||
}, '{ x: 0, y: 0 }');
|
||||
});
|
||||
|
||||
test('Symbol#place(position)', function() {
|
||||
var path = new Path.Circle([50, 50], 50);
|
||||
var symbol = new Symbol(path);
|
||||
var placedSymbol = symbol.place(new Point(100, 100));
|
||||
equals(function() {
|
||||
return placedSymbol.position.toString();
|
||||
}, '{ x: 100, y: 100 }');
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue