Separate internal and API methods for the view

This commit is contained in:
Tim Schaub
2019-08-11 17:28:28 -06:00
parent f73d0b16ec
commit c03c359a20
17 changed files with 214 additions and 69 deletions
@@ -99,20 +99,20 @@ describe('ol.interaction.MouseWheelZoom', function() {
});
}
describe('spying on view.animate()', function() {
describe('spying on view.animateInternal()', function() {
let view;
beforeEach(function() {
view = map.getView();
sinon.spy(view, 'animate');
sinon.spy(view, 'animateInternal');
});
afterEach(function() {
view.animate.restore();
view.animateInternal.restore();
});
it('works in DOM_DELTA_LINE mode (wheel)', function(done) {
map.once('postrender', function() {
const call = view.animate.getCall(0);
const call = view.animateInternal.getCall(0);
expect(call.args[0].resolution).to.be(2);
expect(call.args[0].anchor).to.eql([0, 0]);
done();
@@ -132,7 +132,7 @@ describe('ol.interaction.MouseWheelZoom', function() {
it('works on all browsers (wheel)', function(done) {
map.once('postrender', function() {
const call = view.animate.getCall(0);
const call = view.animateInternal.getCall(0);
expect(call.args[0].resolution).to.be(2);
expect(call.args[0].anchor).to.eql([0, 0]);
done();