From 10343f43a70affa329cc31273d8fe4e906e00ef9 Mon Sep 17 00:00:00 2001 From: Derek Gavey Date: Fri, 4 Sep 2020 09:35:19 -0600 Subject: [PATCH] Fixed merged conflict with #170 --- addon-test-support/helpers/drag-drop.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/addon-test-support/helpers/drag-drop.js b/addon-test-support/helpers/drag-drop.js index 77f30f0..5e94ed6 100644 --- a/addon-test-support/helpers/drag-drop.js +++ b/addon-test-support/helpers/drag-drop.js @@ -12,7 +12,7 @@ async function dragOver(dropSelector, moves) { } } -async function drop(dragSelector, dragEvent, options) { +async function drop(dragElement, dragEvent, options) { let { drop: dropSelector, dropEndOptions, dragOverMoves } = options; let dropElement = await find(dropSelector); @@ -29,11 +29,12 @@ async function drop(dragSelector, dragEvent, options) { let event = new MockEvent().useDataTransferData(dragEvent); await triggerEvent(dropSelector, 'drop', event); - return await triggerEvent(dragSelector, 'dragend', dropEndOptions); + return await triggerEvent(dragElement, 'dragend', dropEndOptions); } export async function drag(dragSelector, options = {}) { let dragEvent = new MockEvent(options.dragStartOptions); + const dragElement = document.querySelector(dragSelector); await triggerEvent(dragSelector, 'mouseover'); @@ -44,6 +45,6 @@ export async function drag(dragSelector, options = {}) { } if (options.drop) { - await drop(dragSelector, dragEvent, options); + await drop(dragElement, dragEvent, options); } } \ No newline at end of file