mirror of
https://github.com/konvajs/konva.git
synced 2025-11-24 08:46:44 +08:00
fix tests
This commit is contained in:
@@ -102,7 +102,7 @@ describe('AutoDraw', function () {
|
||||
});
|
||||
|
||||
// ======================================================
|
||||
it.only('redraw for images', function (done) {
|
||||
it('redraw for images', function (done) {
|
||||
// don't test on node, because of specific url access
|
||||
if (isNode) {
|
||||
return;
|
||||
|
||||
@@ -1475,7 +1475,7 @@ describe('Caching', function () {
|
||||
});
|
||||
});
|
||||
|
||||
test('hit from cache with custom pixelRatio', function () {
|
||||
it('hit from cache with custom pixelRatio', function () {
|
||||
var stage = addStage();
|
||||
|
||||
var layer = new Konva.Layer();
|
||||
@@ -1496,7 +1496,7 @@ describe('Caching', function () {
|
||||
});
|
||||
layer.draw();
|
||||
|
||||
var hitCanvas = rect._cache.get("canvas").hit;
|
||||
var hitCanvas = rect._cache.get('canvas').hit;
|
||||
assert.equal(hitCanvas._canvas.width, rect.width() * 0.2);
|
||||
assert.equal(hitCanvas._canvas.height, rect.height() * 0.2);
|
||||
assert.equal(hitCanvas.pixelRatio, 0.2);
|
||||
@@ -1508,8 +1508,9 @@ describe('Caching', function () {
|
||||
context.closePath();
|
||||
context.fillStyle = 'green';
|
||||
context.fill();
|
||||
showHit(layer);
|
||||
|
||||
compareLayerAndCanvas(layer, canvas, 5);
|
||||
|
||||
assert.equal(stage.getIntersection({ x: 150, y: 100 }), rect);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user