Automated test runners such as Cypress cannot interact with system dialogs such as the file selection dialog box. In order to allow testing this module, this change does two things:
It does not remove the input from the DOM until the file has changed. Previously it was removed on the next animation frame, but now it's removed in the onchange handler. For actual human interaction, this change should behave equivalently, but for test runners it gives them a chance to find and upload a file to the file input.
There is a configurable data-testid attribute for the file input. This data attribute is a common one for test frameworks and allows them to find the input easily.
Automated test runners such as Cypress cannot interact with system dialogs such as the file selection dialog box. In order to allow testing this module, this change does two things:
data-testid
attribute for the file input. This data attribute is a common one for test frameworks and allows them to find the input easily.