Replace happen.drag by prosthetic-hand in specs
This commit is contained in:
parent
24a2a11715
commit
61da775379
@ -51,29 +51,6 @@ happen.at = function (what, x, y, props) {
|
||||
button: 0
|
||||
}, props || {}));
|
||||
};
|
||||
happen.drag = function (fromX, fromY, toX, toY, then, duration) {
|
||||
happen.at('mousemove', fromX, fromY);
|
||||
happen.at('mousedown', fromX, fromY);
|
||||
var moveX = function () {
|
||||
if (fromX <= toX) {
|
||||
happen.at('mousemove', fromX++, fromY);
|
||||
window.setTimeout(moveX, 5);
|
||||
}
|
||||
};
|
||||
moveX();
|
||||
var moveY = function () {
|
||||
if (fromY <= toY) {
|
||||
happen.at('mousemove', fromX, fromY++);
|
||||
window.setTimeout(moveY, 5);
|
||||
}
|
||||
};
|
||||
moveY();
|
||||
window.setTimeout(function () {
|
||||
happen.at('mouseup', toX, toY);
|
||||
happen.at('click', toX, toY);
|
||||
if (then) { then(); }
|
||||
}, duration || 100);
|
||||
};
|
||||
|
||||
// We'll want to skip a couple of things when in PhantomJS, due to lack of CSS animations
|
||||
it.skipInPhantom = L.Browser.any3d ? it : it.skip;
|
||||
|
@ -290,12 +290,17 @@ describe("L.Map#openPopup", function () {
|
||||
map.openPopup(p);
|
||||
expect(map.hasLayer(p)).to.be(true);
|
||||
map.on('drag', spy);
|
||||
happen.drag(coords.left + 100, coords.top + 100, coords.left + 110, coords.top + 110, function () {
|
||||
var hand = new Hand({timing: 'fastframe'});
|
||||
var mouse = hand.growFinger('mouse');
|
||||
mouse.moveTo(coords.left + 100, coords.left + 100, 0)
|
||||
.down().moveBy(10, 10, 20).up();
|
||||
|
||||
setTimeout(function () {
|
||||
expect(spy.called).to.be(true);
|
||||
expect(map.hasLayer(p)).to.be(true);
|
||||
document.body.removeChild(c);
|
||||
done();
|
||||
});
|
||||
}, 60);
|
||||
});
|
||||
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user