From d8a6ad40105aacc835deb37a3a387a86f52abc95 Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Thu, 16 Jun 2016 15:34:16 +0200 Subject: [PATCH] Use proper Hand onStop callback instead of setTimeout in popup spec --- spec/suites/layer/PopupSpec.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/spec/suites/layer/PopupSpec.js b/spec/suites/layer/PopupSpec.js index 86d9f1af..9cd39c6b 100644 --- a/spec/suites/layer/PopupSpec.js +++ b/spec/suites/layer/PopupSpec.js @@ -315,16 +315,16 @@ describe("L.Map#openPopup", function () { map.openPopup(p); expect(map.hasLayer(p)).to.be(true); map.on('drag', spy); - var hand = new Hand({timing: 'fastframe'}); + var hand = new Hand({ + timing: 'fastframe', + onStop: function () { + expect(spy.called).to.be(true); + expect(map.hasLayer(p)).to.be(true); + done(); + }}); 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); - done(); - }, 100); }); });