You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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 thetext/plain
data whengetData('text')
is called.Suggested solution
Since user-event's
paste
functionality seems to expect that the mockedDataTransfer
object behaves as the internally mocked version does, it would be really helpful to exposecreateDataTransfer
to allow the user to create an instance of that version.Additional context
No response
The text was updated successfully, but these errors were encountered: