Skip to content

Instantly share code, notes, and snippets.

View smooney's full-sized avatar

Sean Mooney smooney

  • Squarespace
  • Queens, NY
View GitHub Profile
@smooney
smooney / seleniumReactDragAndDrop.js
Last active May 2, 2018 15:42
Quick function to get Selenium Webdriver to work with React drag and drop methods. Dependencies on React and React Test Utils.
// driver.execute_script(path/to/this/script, dragElement, dropElement)
(function(dragItem, dropZone) {
var simulateDragDrop = function(dragItem, dropZone) {
var mockEvent = {
dataTransfer: {
data: {
},
setData: function(type, val){
this.data[type] = val;