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

Trigger pointerdown and pointerup on disabled elements #804

Closed
ph-fritsche opened this issue Dec 8, 2021 · 1 comment · Fixed by #818
Closed

Trigger pointerdown and pointerup on disabled elements #804

ph-fritsche opened this issue Dec 8, 2021 · 1 comment · Fixed by #818
Labels
accuracy Improves the accuracy of how behavior is simulated released on @beta
Milestone

Comments

@ph-fritsche
Copy link
Member

  • @testing-library/user-event version: v14.0.0-beta.2

Problem description:

const {element, getEventSnapshot, getEvents} = setup('<button disabled />')
await userEvent.pointer([{target: element}, {keys: '[MouseLeft]'}])
expect(getEventSnapshot()).toMatchInlineSnapshot(`
Events fired on: button
button - pointerover
button - pointerenter
button - pointermove
`)
expect(getEvents('pointerover')).toHaveLength(1)
// TODO: pointer down/up also happen on disabled elements
// expect(getEvents('pointerdown')).toHaveLength(1)

Suggested solution:

Fix pointer events in https://github.com/testing-library/user-event/blob/beta/src/pointer/pointerPress.ts accordingly.

@ph-fritsche ph-fritsche added the accuracy Improves the accuracy of how behavior is simulated label Dec 8, 2021
@ph-fritsche ph-fritsche added this to the userEvent v14 milestone Dec 8, 2021
@ph-fritsche ph-fritsche linked a pull request Dec 29, 2021 that will close this issue
2 tasks
@github-actions
Copy link

github-actions bot commented Jan 1, 2022

🎉 This issue has been resolved in version 14.0.0-beta.6 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accuracy Improves the accuracy of how behavior is simulated released on @beta
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant