setup prettier and make all code better

This commit is contained in:
Anton Lavrenov
2017-02-24 09:15:33 -05:00
parent bfb859cfca
commit 59cc7b99f2
124 changed files with 47390 additions and 41165 deletions

View File

@@ -1,25 +1,56 @@
suite('BaseLayer', function() {
// ======================================================
test('width and height', function() {
var stage = addStage();
// ======================================================
test('width and height', function() {
var stage = addStage();
var layer = new Konva.FastLayer();
assert.equal(
layer.width(),
undefined,
'while layer is not on stage width is undefined'
);
assert.equal(
layer.height(),
undefined,
'while layer is not on stage height is undefined'
);
var layer = new Konva.FastLayer();
assert.equal(layer.width(), undefined, 'while layer is not on stage width is undefined');
assert.equal(layer.height(), undefined, 'while layer is not on stage height is undefined');
layer.width(10);
assert.equal(layer.width(), undefined, 'while layer is not on stage changing width doing nothing');
layer.height(10);
assert.equal(layer.height(), undefined, 'while layer is not on stage changing height doing nothing');
stage.add(layer);
layer.width(10);
assert.equal(
layer.width(),
undefined,
'while layer is not on stage changing width doing nothing'
);
layer.height(10);
assert.equal(
layer.height(),
undefined,
'while layer is not on stage changing height doing nothing'
);
stage.add(layer);
assert.equal(layer.width(), stage.width(), 'while layer is on stage width is stage`s width');
assert.equal(layer.height(), stage.height(), 'while layer is on stage height is stage`s height');
assert.equal(
layer.width(),
stage.width(),
'while layer is on stage width is stage`s width'
);
assert.equal(
layer.height(),
stage.height(),
'while layer is on stage height is stage`s height'
);
layer.width(10);
assert.equal(layer.width(), stage.width(), 'while layer is on stage changing width doing nothing');
layer.height(10);
assert.equal(layer.height(), stage.height(), 'while layer is on stage changing height doing nothing');
});
});
layer.width(10);
assert.equal(
layer.width(),
stage.width(),
'while layer is on stage changing width doing nothing'
);
layer.height(10);
assert.equal(
layer.height(),
stage.height(),
'while layer is on stage changing height doing nothing'
);
});
});