Add tests for Symbol#place

This commit is contained in:
Jonathan Puckey 2011-06-03 22:27:18 +02:00
parent 7abdce4f9c
commit 9cb362d389

View file

@ -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 }');
});