mirror of
https://github.com/konvajs/konva.git
synced 2026-03-03 16:58:33 +08:00
finished migrating all shape unit tests over to mocha. continued working on context tracing support
This commit is contained in:
22
test/unit/shapes/Ellipse-test.js
Normal file
22
test/unit/shapes/Ellipse-test.js
Normal file
@@ -0,0 +1,22 @@
|
||||
suite('Ellipse', function(){
|
||||
|
||||
// ======================================================
|
||||
test('add ellipse', function(){
|
||||
var stage = buildStage();
|
||||
var layer = new Kinetic.Layer();
|
||||
var ellipse = new Kinetic.Ellipse({
|
||||
x: stage.getWidth() / 2,
|
||||
y: stage.getHeight() / 2,
|
||||
radius: [70, 35],
|
||||
fill: 'green',
|
||||
stroke: 'black',
|
||||
strokeWidth: 8
|
||||
});
|
||||
layer.add(ellipse);
|
||||
stage.add(layer);
|
||||
assert.equal(ellipse.getClassName(), 'Ellipse');
|
||||
|
||||
var trace = layer.getContext().getTrace();
|
||||
assert.equal(trace, 'clearRect(0,0,578,200);save();transform(1,0,0,1,289,100);beginPath();save();scale(1,0.5);arc(0,0,70,0,6.283,false);restore();closePath();fillStyle=green;fill();lineWidth=8;strokeStyle=black;stroke();restore()');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user