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

[BUG] cypress/react18 behaves inconsistently on onmousemove events in component tests #30418

Open
niels-van-den-broeck opened this issue Oct 17, 2024 · 2 comments
Labels
CT Issue related to component testing stage: needs investigating Someone from Cypress needs to look at this

Comments

@niels-van-den-broeck
Copy link

niels-van-den-broeck commented Oct 17, 2024

Current behavior

Mousemove events in my example don't seem to be triggered when using cypress/react18.

Desired behavior

Same behaviour as cypress/react. Being the container actually being moved onmousemove

Test code to reproduce

I have created a repro using the packages we used. The behaviour I am trying to check is dragging the component from one place to another which requires a combination of mousedown -> mousemove -> mouseup events on the target drag handle

https://github.com/niels-van-den-broeck/cypress-18-draggable-repro

Cypress Version

13.15.0

Node version

20.17.0

Operating System

macOS 14.3

Debug Logs

Logs are too long. Github does not allow pasting here

Other

Test does not fail, but visually behaviour change is clear.

I used npx cypress open --component to run the tests locally.
Changing the cypress/support/component.js file from import { mount } from 'cypress/react18' to import { mount } from 'cypress/react' should clear up the issue.

@niels-van-den-broeck niels-van-den-broeck changed the title [BUG] cypress/react18 behaves inconsistently on onmousemove events [BUG] cypress/react18 behaves inconsistently on onmousemove events in component tests Oct 17, 2024
@niels-van-den-broeck
Copy link
Author

React18 mount state after test:

image

React mount state after test (expected):

image

@niels-van-den-broeck
Copy link
Author

niels-van-den-broeck commented Oct 17, 2024

Some more context:

This behaviour seems to be tied to this library. From what I've gathered so far, they attach the mousemove events to the ownerDocument of the node which is draggable.
I've tried changing the mousemove events to be triggered on cy.document() but no success

@jennifer-shehane jennifer-shehane added stage: needs investigating Someone from Cypress needs to look at this CT Issue related to component testing labels Oct 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CT Issue related to component testing stage: needs investigating Someone from Cypress needs to look at this
Projects
None yet
Development

No branches or pull requests

2 participants