Confirm zoomByDelta calls view.animate()

This commit is contained in:
Tim Schaub
2019-09-26 18:27:40 +02:00
parent dc5a25b96b
commit 53e2f432e7

View File

@@ -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);
});
});