Show a warning for incorrect value for component setters. Fix some TODOs

This commit is contained in:
Anton Lavrenov
2019-01-27 15:43:50 -05:00
parent a0b2f027ba
commit 31785f6323
13 changed files with 141 additions and 1352 deletions

View File

@@ -3789,4 +3789,18 @@ suite('Node', function() {
assert.equal(layer.getChildren().length, 1);
assert.equal(rect3.getZIndex(), 0);
});
test('show warning when we are trying to use non-objects for component setters', function() {
var stage = addStage();
var callCount = 0;
var oldWarn = Konva.Util.warn;
Konva.Util.warn = function() {
callCount += 1;
};
stage.scale(0.5);
assert.equal(callCount, 1);
Konva.Util.warn = oldWarn;
});
});