mirror of
https://github.com/konvajs/konva.git
synced 2026-01-23 13:26:07 +08:00
fix array serialization. fix #576
This commit is contained in:
@@ -2538,7 +2538,8 @@ suite('Node', function() {
|
||||
stroke: 'black',
|
||||
strokeWidth: 4,
|
||||
name: 'myCircle',
|
||||
draggable: true
|
||||
draggable: true,
|
||||
dash: [5, 5]
|
||||
});
|
||||
|
||||
stage.add(layer);
|
||||
@@ -2547,7 +2548,7 @@ suite('Node', function() {
|
||||
layer.draw();
|
||||
|
||||
var expectedJson =
|
||||
'{"attrs":{"x":289,"y":100,"radius":70,"fill":"green","stroke":"black","strokeWidth":4,"name":"myCircle","draggable":true},"className":"Circle"}';
|
||||
'{"attrs":{"x":289,"y":100,"radius":70,"fill":"green","stroke":"black","strokeWidth":4,"name":"myCircle","draggable":true,"dash":[5,5]},"className":"Circle"}';
|
||||
|
||||
assert.equal(circle.toJSON(), expectedJson);
|
||||
});
|
||||
|
||||
@@ -45,5 +45,9 @@ suite('Filter', function() {
|
||||
layer.draw();
|
||||
|
||||
var json = circle.toJSON();
|
||||
|
||||
var newCircle = Konva.Node.create(json);
|
||||
|
||||
assert.deepEqual(newCircle.filters(), [Konva.Filters.Blur]);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user