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

Export createDataTransfer util function #1245

Open
DanielGibbsNZ opened this issue Dec 13, 2024 · 0 comments
Open

Export createDataTransfer util function #1245

DanielGibbsNZ opened this issue Dec 13, 2024 · 0 comments
Labels
enhancement New feature or request needs assessment This needs to be looked at by a team member

Comments

@DanielGibbsNZ
Copy link

Problem description

When testing paste functionality, it would be really helpful to be able to use the internal createDataTransfer functionality.

I've previously created a simple mock of the DataTransfer object but this can cause frustrating test failures when it doesn't behave in exactly the same way that user-event expects it to, e.g. returning the text/plain data when getData('text') is called.

Suggested solution

Since user-event's paste functionality seems to expect that the mocked DataTransfer object behaves as the internally mocked version does, it would be really helpful to expose createDataTransfer to allow the user to create an instance of that version.

Additional context

No response

@DanielGibbsNZ DanielGibbsNZ added enhancement New feature or request needs assessment This needs to be looked at by a team member labels Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs assessment This needs to be looked at by a team member
Projects
None yet
Development

No branches or pull requests

1 participant