From 1c8ed12b686e01050cbca647950d5f01149f0acc Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Sat, 15 Oct 2016 05:45:23 -0600 Subject: [PATCH] Assert that the freehand option properly sets the condition --- test/spec/ol/interaction/draw.test.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/spec/ol/interaction/draw.test.js b/test/spec/ol/interaction/draw.test.js index 0c8908c4b8..57c10c1111 100644 --- a/test/spec/ol/interaction/draw.test.js +++ b/test/spec/ol/interaction/draw.test.js @@ -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() {