feat!: remove support for user provided MouseEventInit
#784
+45
−57
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.
BREAKING CHANGE:
init
parameter has been removed from these APIs:userEvent.click
userEvent.dblClick
userEvent.tripleClick
userEvent.hover
userEvent.unhover
userEvent.selectOptions
userEvent.deselectOptions
BREAKING CHANGE:
userEvent.upload
no longer supportsclickInit
as part of its
init
parameter.What:
Remove
init
parameters forEventInit
of mouse/pointer events.Why:
The
init
parameters are escape hatches.They were used for different events that don't necessarily share the same properties.
The new pointer implementation renders supplying own
MouseEventInit
properties obsolete as the events are created according to specs / living standard.If our code lacks non-deprecated features from the specs, we should add them.
If our users want to test features outside of the specs, they should be on their own using lower level implementations.
The
init
parameter encourages bad practice as it makes it convenient to just tweak the events instead of describing a user interaction that might lead up to those events.Checklist: