Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testing DnD with Cypress #172

Open
joetidee opened this issue Dec 29, 2024 · 0 comments
Open

Testing DnD with Cypress #172

joetidee opened this issue Dec 29, 2024 · 0 comments

Comments

@joetidee
Copy link

joetidee commented Dec 29, 2024

I am migrating over from react-beautiful-dnd (RBD) to pragmatic-dnd (PD). I had some Cypress tests working with RBD, which were modelled on this example. However, now I am on PD, they no longer work.

I found this plugin, but this also doesn't seem to be dragging the draggable element.

I noticed a Cypress example on the PD website, but this also does not seem to be dragging the element, for example:

const options = {
      force: true,
      eventConstructor: 'DragEvent',
      // If you wanted to fake dragging particular data,
      // you can add it to this `DataTransfer` with `.setData()`
      // See: https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer
      dataTransfer: new DataTransfer(),
  };
  cy.get(subject).trigger('dragstart', options);
  cy.get(target).trigger('dragenter', options).trigger('drop', options);

Does PD work with Cypress at all? If so, do you have any examples of tests or plugins that should support it?

I'm using Cypress 13.17.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant