Assert that the freehand option properly sets the condition

This commit is contained in:
Tim Schaub
2016-10-15 05:45:23 -06:00
parent fad6d368a6
commit 1c8ed12b68

View File

@@ -88,6 +88,22 @@ describe('ol.interaction.Draw', function() {
expect(draw).to.be.a(ol.interaction.Interaction);
});
it('accepts a freehand option', function() {
var draw = new ol.interaction.Draw({
source: source,
type: 'LineString',
freehand: true
});
var event = new ol.pointer.PointerEvent('pointerdown', {
clientX: 0,
clientY: 0,
shiftKey: false
});
expect(draw.freehandCondition_(event)).to.be(true);
});
});
describe('specifying a geometryName', function() {