Test that an animation series works with an undefined view

This commit is contained in:
Tim Schaub
2017-08-15 13:33:19 -04:00
parent 940f97e2a7
commit ae62f5a682

View File

@@ -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],