Add tests, remove unused code, encapsulate repeated code in functions
This commit is contained in:
25
test/spec/ol/render/canvas.test.js
Normal file
25
test/spec/ol/render/canvas.test.js
Normal file
@@ -0,0 +1,25 @@
|
||||
goog.provide('ol.test.render.canvas');
|
||||
|
||||
|
||||
describe('ol.render.canvas', function() {
|
||||
|
||||
describe('rotateAtOffset', function() {
|
||||
it('rotates a canvas at an offset point', function() {
|
||||
var context = {
|
||||
translate: sinon.spy(),
|
||||
rotate: sinon.spy()
|
||||
};
|
||||
ol.render.canvas.rotateAtOffset(context, Math.PI, 10, 10);
|
||||
expect(context.translate.callCount).to.be(2);
|
||||
expect(context.translate.firstCall.args).to.eql([10, 10]);
|
||||
expect(context.translate.secondCall.args).to.eql([-10, -10]);
|
||||
expect(context.rotate.callCount).to.be(1);
|
||||
expect(context.rotate.firstCall.args).to.eql([Math.PI]);
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
goog.require('ol.render');
|
||||
goog.require('ol.render.canvas');
|
||||
Reference in New Issue
Block a user