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:
39
test/unit/shapes/Polygon-test.js
Normal file
39
test/unit/shapes/Polygon-test.js
Normal file
@@ -0,0 +1,39 @@
|
||||
suite('Polygon', function() {
|
||||
test('add polygon', function() {
|
||||
var stage = buildStage();
|
||||
|
||||
var layer = new Kinetic.Layer();
|
||||
|
||||
var points = [{
|
||||
x: 73,
|
||||
y: 192
|
||||
}, {
|
||||
x: 73,
|
||||
y: 160
|
||||
}, {
|
||||
x: 340,
|
||||
y: 23
|
||||
}, {
|
||||
x: 500,
|
||||
y: 109
|
||||
}, {
|
||||
x: 499,
|
||||
y: 139
|
||||
}, {
|
||||
x: 342,
|
||||
y: 93
|
||||
}];
|
||||
|
||||
var poly = new Kinetic.Polygon({
|
||||
points: points,
|
||||
fill: 'green',
|
||||
stroke: 'blue',
|
||||
strokeWidth: 5
|
||||
});
|
||||
|
||||
layer.add(poly);
|
||||
stage.add(layer);
|
||||
|
||||
assert.equal(poly.getClassName(), 'Polygon');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user