From 53e2f432e7c6bd41f1828340cb05c97ae8f49a38 Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Thu, 26 Sep 2019 18:27:40 +0200 Subject: [PATCH] Confirm zoomByDelta calls view.animate() --- test/spec/ol/interaction/interaction.test.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/test/spec/ol/interaction/interaction.test.js b/test/spec/ol/interaction/interaction.test.js index cec796e574..21cd5ce2df 100644 --- a/test/spec/ol/interaction/interaction.test.js +++ b/test/spec/ol/interaction/interaction.test.js @@ -93,20 +93,20 @@ describe('zoomByDelta - useGeographic', () => { beforeEach(useGeographic); afterEach(clearUserProjection); - it('works with a user projection set', done => { + it('works with a user projection set', () => { const view = new View({ center: [0, 0], zoom: 0 }); + const spy = sinon.spy(view, 'animate'); + const anchor = [90, 45]; const duration = 10; zoomByDelta(view, 1, anchor, duration); - setTimeout(() => { - const center = view.getCenter(); - expect(center[0]).to.be(45); - expect(center[1]).to.roughlyEqual(24.4698, 1e-4); - done(); - }, 2 * duration); + + expect(spy.callCount).to.be(1); + const options = spy.getCall(0).args[0]; + expect(options.anchor).to.be(anchor); }); });