Mock PointerEvent in tests to include target
The `target` Event property is readonly as it is set internally when an event is dispatched. This change uses a plain object with the essential properties that a PointerEvent has which is sufficent for map event handling
This commit is contained in:
@@ -84,6 +84,7 @@ describe('ol.interaction.Modify', function() {
|
||||
const position = viewport.getBoundingClientRect();
|
||||
const pointerEvent = new Event();
|
||||
pointerEvent.type = type;
|
||||
pointerEvent.target = viewport.firstChild;
|
||||
pointerEvent.clientX = position.left + x + width / 2;
|
||||
pointerEvent.clientY = position.top + y + height / 2;
|
||||
pointerEvent.shiftKey = modifiers.shift || false;
|
||||
|
||||
Reference in New Issue
Block a user