How to test drag and drop functionality with Cypress and react-dnd

--

First, to search for items easily, I am using the React Testing Library plugin for Cypress.

https://testing-library.com/docs/cypress-testing-library/intro/

It is not needed. You can change your code and use .get

With 2 lines of code you can achieve drag and drop to test your code

To pick the first item I use the following line

Then to drag that item to the destination element i use the following line

--

--

Xavier Perez - thexap

I help companies build beautiful React websites, React Native mobile apps and NodeJS backends https://thexap.tech/