Skip to content

Commit

Permalink
Fixed merged conflict with #170
Browse files Browse the repository at this point in the history
  • Loading branch information
dgavey committed Sep 4, 2020
1 parent c2f0327 commit 10343f4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions addon-test-support/helpers/drag-drop.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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');

Expand All @@ -44,6 +45,6 @@ export async function drag(dragSelector, options = {}) {
}

if (options.drop) {
await drop(dragSelector, dragEvent, options);
await drop(dragElement, dragEvent, options);
}
}

0 comments on commit 10343f4

Please sign in to comment.