Use proper Hand onStop callback instead of setTimeout in popup spec

This commit is contained in:
Yohan Boniface 2016-06-16 15:34:16 +02:00
parent e2caf40cad
commit d8a6ad4010

View File

@ -315,16 +315,16 @@ describe("L.Map#openPopup", function () {
map.openPopup(p); map.openPopup(p);
expect(map.hasLayer(p)).to.be(true); expect(map.hasLayer(p)).to.be(true);
map.on('drag', spy); map.on('drag', spy);
var hand = new Hand({timing: 'fastframe'}); var hand = new Hand({
var mouse = hand.growFinger('mouse'); timing: 'fastframe',
mouse.moveTo(coords.left + 100, coords.left + 100, 0) onStop: function () {
.down().moveBy(10, 10, 20).up();
setTimeout(function () {
expect(spy.called).to.be(true); expect(spy.called).to.be(true);
expect(map.hasLayer(p)).to.be(true); expect(map.hasLayer(p)).to.be(true);
done(); done();
}, 100); }});
var mouse = hand.growFinger('mouse');
mouse.moveTo(coords.left + 100, coords.left + 100, 0)
.down().moveBy(10, 10, 20).up();
}); });
}); });