diff --git a/test/spec/ol/interaction/drawinteraction.test.js b/test/spec/ol/interaction/drawinteraction.test.js index f08bb70617..390baf6b91 100644 --- a/test/spec/ol/interaction/drawinteraction.test.js +++ b/test/spec/ol/interaction/drawinteraction.test.js @@ -49,14 +49,12 @@ describe('ol.interaction.Draw', function() { // calculated in case body has top < 0 (test runner with small window) var position = goog.style.getClientPosition(viewport); var shiftKey = opt_shiftKey !== undefined ? opt_shiftKey : false; - var event = new ol.MapBrowserPointerEvent(type, map, - new ol.pointer.PointerEvent(type, - { - clientX: position.x + x + width / 2, - clientY: position.y + y + height / 2, - shiftKey: shiftKey - })); - map.handleMapBrowserEvent(event); + var event = new ol.pointer.PointerEvent(type, { + clientX: position.x + x + width / 2, + clientY: position.y + y + height / 2, + shiftKey: shiftKey + }); + map.handleMapBrowserEvent(new ol.MapBrowserPointerEvent(type, map, event)); } describe('constructor', function() { diff --git a/test/spec/ol/interaction/modifyinteraction.test.js b/test/spec/ol/interaction/modifyinteraction.test.js index f6f8d5b7dd..d0c0a492e5 100644 --- a/test/spec/ol/interaction/modifyinteraction.test.js +++ b/test/spec/ol/interaction/modifyinteraction.test.js @@ -66,15 +66,14 @@ describe('ol.interaction.Modify', function() { // calculated in case body has top < 0 (test runner with small window) var position = goog.style.getClientPosition(viewport); var shiftKey = opt_shiftKey !== undefined ? opt_shiftKey : false; - var event = new ol.MapBrowserPointerEvent(type, map, - new ol.pointer.PointerEvent(type, - { - type: type, - button: button, - clientX: position.x + x + width / 2, - clientY: position.y + y + height / 2, - shiftKey: shiftKey - })); + var pointerEvent = new ol.pointer.PointerEvent(type, { + type: type, + button: button, + clientX: position.x + x + width / 2, + clientY: position.y + y + height / 2, + shiftKey: shiftKey + }); + var event = new ol.MapBrowserPointerEvent(type, map, pointerEvent); event.pointerEvent.pointerId = 1; map.handleMapBrowserEvent(event); } diff --git a/test/spec/ol/interaction/selectinteraction.test.js b/test/spec/ol/interaction/selectinteraction.test.js index 7bc518130c..6667ae52a2 100644 --- a/test/spec/ol/interaction/selectinteraction.test.js +++ b/test/spec/ol/interaction/selectinteraction.test.js @@ -80,14 +80,12 @@ describe('ol.interaction.Select', function() { // calculated in case body has top < 0 (test runner with small window) var position = goog.style.getClientPosition(viewport); var shiftKey = opt_shiftKey !== undefined ? opt_shiftKey : false; - var event = new ol.MapBrowserPointerEvent(type, map, - new ol.pointer.PointerEvent(type, - { - clientX: position.x + x + width / 2, - clientY: position.y + y + height / 2, - shiftKey: shiftKey - })); - map.handleMapBrowserEvent(event); + var event = new ol.pointer.PointerEvent(type, { + clientX: position.x + x + width / 2, + clientY: position.y + y + height / 2, + shiftKey: shiftKey + }); + map.handleMapBrowserEvent(new ol.MapBrowserPointerEvent(type, map, event)); } describe('constructor', function() {