Update testing-library/user-event to latest version#6231
Merged
Conversation
**Why**: Since there are many improvements, bug fixes, and (importantly, for future reference) breaking changes. changelog: Internal, Dependencies, Update dependencies
mitchellhenke
approved these changes
Apr 21, 2022
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why: Since there are many improvements, bug fixes, and (importantly, for future reference) breaking changes.
Major release changelogs:
I had originally hoped to do a single pass at updating all of the
@testing-library/dependencies, but it's turning out to be a more painful upgrade than I'd anticipated, so I'll be doing it piecemeal.Noteworthy upgrade remarks:
userEventactions are asynchronous, and usually incur a frame tickadvanceTimersoption allows the delay to increment the fake timerskeyCodeorwhichin keyboard events. While these properties are technically deprecated, they are implemented in most browsers and used by many third-party libraries for improved backwards compatibilityPersonalKeyInputspecs, sincecleave.jsrelies onkeyCodeuserEvent.uploadagainst selfie fields is no longer possible because the user-facing behavior of selfie images is to prevent uploaded images. Previously this was not enforced by userEvent, but it is now. Instead, we fire the change event directly.userEvent.uploaddid not previously test the input'sacceptproperty. In fact, I'd previously reported this upstream. At the time, it was regarded as working as intended due to browser-allowable circumvention. Now, the default behavior checksaccept. Since it is still possible to circumvent, we opt-out viaapplyAcceptfor test cases where we were intentionally testing against the circumvention behavior.userEvent.typenow uses standardKeyboardEvent#keyvalues (e.g.{esc}->{Escape})