From ae62f5a682029ab507a82b3ebe9f7ab214238e6f Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Tue, 15 Aug 2017 13:33:19 -0400 Subject: [PATCH] Test that an animation series works with an undefined view --- test/spec/ol/view.test.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/test/spec/ol/view.test.js b/test/spec/ol/view.test.js index 094cccd163..f57ec3141e 100644 --- a/test/spec/ol/view.test.js +++ b/test/spec/ol/view.test.js @@ -489,6 +489,31 @@ describe('ol.View', function() { expect(view.getRotation()).to.eql(rotation); }); + it('sets final animation state if view is not defined before', function() { + var view = new ol.View(); + + var center = [1, 2]; + var zoom = 3; + var rotation = 0.4; + + view.animate({ + zoom: 1 + }, { + center: [2, 3] + }, { + rotation: 4 + }, { + zoom: zoom, + center: center, + rotation: rotation, + duration: 25 + }); + expect(view.getAnimating()).to.eql(false); + expect(view.getCenter()).to.eql(center); + expect(view.getZoom()).to.eql(zoom); + expect(view.getRotation()).to.eql(rotation); + }); + it('prefers zoom over resolution', function(done) { var view = new ol.View({ center: [0, 0],