fix array serialization. fix #576

This commit is contained in:
Anton Lavrenov
2019-02-11 08:46:34 -05:00
parent 12fbe870bd
commit 128b5b403e
6 changed files with 94 additions and 9 deletions

View File

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

View File

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