Files
openlayers/test/browser/spec/ol/rotationconstraint.test.js
2021-04-28 09:23:33 -07:00

20 lines
696 B
JavaScript

import {createSnapToZero} from '../../../../src/ol/rotationconstraint.js';
describe('ol.rotationconstraint', function () {
describe('SnapToZero', function () {
it('returns expected rotation value', function () {
const rotationConstraint = createSnapToZero(0.3);
expect(rotationConstraint(0.1)).to.eql(0);
expect(rotationConstraint(0.2)).to.eql(0);
expect(rotationConstraint(0.3)).to.eql(0);
expect(rotationConstraint(0.4)).to.eql(0.4);
expect(rotationConstraint(-0.1)).to.eql(0);
expect(rotationConstraint(-0.2)).to.eql(0);
expect(rotationConstraint(-0.3)).to.eql(0);
expect(rotationConstraint(-0.4)).to.eql(-0.4);
});
});
});