Reproduction example
https://codesandbox.io/p/sandbox/datatransferitem-getasstring-t693n7
Prerequisites
- Create
DataTransferItem
- Read data of item per
DataTransferItem.getAsString()
Expected behavior
Callback is called on new event loop step.
Actual behavior
The stub calls the callback immediately.
User-event version
14.5.2
Environment
Testing Library framework:
JS framework:
Test environment:
DOM implementation:
Additional context
The Clipboard methods rely on the immediate call of the callback and therefore break when the browser implementation of DataTransferItem is used.