mirror of
https://github.com/konvajs/konva.git
synced 2026-01-21 18:51:52 +08:00
Tests cleanup
This commit is contained in:
@@ -1780,7 +1780,7 @@ suite('MouseEvents', function() {
|
||||
assert.equal(shape, circle);
|
||||
});
|
||||
|
||||
it('double click after click should trigger event', function(done) {
|
||||
test('double click after click should trigger event', function(done) {
|
||||
var stage = addStage();
|
||||
var layer = new Konva.Layer();
|
||||
stage.add(layer);
|
||||
@@ -1865,7 +1865,7 @@ suite('MouseEvents', function() {
|
||||
});
|
||||
});
|
||||
|
||||
it('double click after drag should trigger event', function(done) {
|
||||
test('double click after drag should trigger event', function(done) {
|
||||
var stage = addStage();
|
||||
var layer = new Konva.Layer();
|
||||
stage.add(layer);
|
||||
|
||||
@@ -451,7 +451,7 @@ suite('Layer', function() {
|
||||
);
|
||||
});
|
||||
|
||||
it('get/set layer size', function() {
|
||||
test('get/set layer size', function() {
|
||||
var stage = addStage();
|
||||
var layer = new Konva.Layer();
|
||||
stage.add(layer);
|
||||
|
||||
@@ -3530,9 +3530,8 @@ suite('Node', function() {
|
||||
|
||||
assert.equal(rect.findAncestor(), null, 'return null if no selector');
|
||||
});
|
||||
});
|
||||
|
||||
test('moveToTop() properly changes z-indices of the node and its siblings', function() {
|
||||
test('moveToTop() properly changes z-indices of the node and its siblings', function() {
|
||||
var stage = addStage();
|
||||
var layer = new Konva.Layer();
|
||||
stage.add(layer);
|
||||
@@ -3561,9 +3560,9 @@ test('moveToTop() properly changes z-indices of the node and its siblings', func
|
||||
assert.equal(rect4.getZIndex(), 1);
|
||||
assert.equal(rect2.getZIndex(), 2);
|
||||
assert.equal(rect1.getZIndex(), 3);
|
||||
});
|
||||
});
|
||||
|
||||
test('moveToBottom() properly changes z-indices of the node and its siblings', function() {
|
||||
test('moveToBottom() properly changes z-indices of the node and its siblings', function() {
|
||||
var stage = addStage();
|
||||
var layer = new Konva.Layer();
|
||||
stage.add(layer);
|
||||
@@ -3592,9 +3591,9 @@ test('moveToBottom() properly changes z-indices of the node and its siblings', f
|
||||
assert.equal(rect3.getZIndex(), 1);
|
||||
assert.equal(rect1.getZIndex(), 2);
|
||||
assert.equal(rect2.getZIndex(), 3);
|
||||
});
|
||||
});
|
||||
|
||||
test('moveUp() properly changes z-indices of the node and its siblings', function() {
|
||||
test('moveUp() properly changes z-indices of the node and its siblings', function() {
|
||||
var stage = addStage();
|
||||
var layer = new Konva.Layer();
|
||||
stage.add(layer);
|
||||
@@ -3623,9 +3622,9 @@ test('moveUp() properly changes z-indices of the node and its siblings', functio
|
||||
assert.equal(rect1.getZIndex(), 1);
|
||||
assert.equal(rect4.getZIndex(), 2);
|
||||
assert.equal(rect3.getZIndex(), 3);
|
||||
});
|
||||
});
|
||||
|
||||
test('moveDown() properly changes z-indices of the node and its siblings', function() {
|
||||
test('moveDown() properly changes z-indices of the node and its siblings', function() {
|
||||
var stage = addStage();
|
||||
var layer = new Konva.Layer();
|
||||
stage.add(layer);
|
||||
@@ -3654,9 +3653,9 @@ test('moveDown() properly changes z-indices of the node and its siblings', funct
|
||||
assert.equal(rect1.getZIndex(), 1);
|
||||
assert.equal(rect4.getZIndex(), 2);
|
||||
assert.equal(rect3.getZIndex(), 3);
|
||||
});
|
||||
});
|
||||
|
||||
test('setZIndex() properly changes z-indices of the node and its siblings', function() {
|
||||
test('setZIndex() properly changes z-indices of the node and its siblings', function() {
|
||||
var stage = addStage();
|
||||
var layer = new Konva.Layer();
|
||||
stage.add(layer);
|
||||
@@ -3699,9 +3698,9 @@ test('setZIndex() properly changes z-indices of the node and its siblings', func
|
||||
assert.equal(rect3.getZIndex(), 1);
|
||||
assert.equal(rect2.getZIndex(), 2);
|
||||
assert.equal(rect1.getZIndex(), 3);
|
||||
});
|
||||
});
|
||||
|
||||
test('remove() removes the node and properly changes z-indices of its siblings', function() {
|
||||
test('remove() removes the node and properly changes z-indices of its siblings', function() {
|
||||
var stage = addStage();
|
||||
var layer = new Konva.Layer();
|
||||
stage.add(layer);
|
||||
@@ -3735,4 +3734,5 @@ test('remove() removes the node and properly changes z-indices of its siblings',
|
||||
|
||||
assert.equal(layer.getChildren().length, 1);
|
||||
assert.equal(rect3.getZIndex(), 0);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -243,7 +243,7 @@ suite('Label', function() {
|
||||
cloneAndCompareLayer(layer, 100);
|
||||
});
|
||||
|
||||
it('tag should list text size changes', function() {
|
||||
test('tag should list text size changes', function() {
|
||||
var stage = addStage();
|
||||
var layer = new Konva.Layer();
|
||||
stage.add(layer);
|
||||
|
||||
@@ -1140,7 +1140,7 @@ suite('Path', function() {
|
||||
);
|
||||
});
|
||||
|
||||
it('getClientRect', function() {
|
||||
test('getClientRect', function() {
|
||||
var stage = addStage();
|
||||
var layer = new Konva.Layer();
|
||||
stage.add(layer);
|
||||
|
||||
Reference in New Issue
Block a user