Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add media events back to TestUtils.Simulate #12010

Merged

Conversation

nhunzaker
Copy link
Contributor

The TestUtils lost media events when they were pulled out of the topLevelTypes constant. This commit adds them back by concatenating the media event keys to the list of top level types.

I tested this by recording a snapshot of the simulated events list on master before this commit. This will have to be updated every time we add a new event, but it should at least give us some extra.

The TestUtils lost media events when they were pulled out of the
topLevelTypes constant. This commit adds them back by concatenating
the media event keys to the list of top level types.
const eventKeys = [].concat(
Object.keys(topLevelTypes),
Object.keys(mediaEventTypes),
);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could use EventPluginRegistry.eventNameDispatchConfigs for SimulateNative, but it:

  1. Does not include invalid, mouseEnter, mouseLeave, reset, select, or submit.
  2. Adds selectionChange, textInput

Curiously, this is the case for ReactTestUtils.Simulate. Is this correct?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whatever’s currently there is “correct” in the sense that we shouldn’t change it now, and we should remove SimilateNative altogether in 17.

@nhunzaker nhunzaker merged commit 3766a01 into facebook:master Jan 12, 2018
ManasJayanth pushed a commit to ManasJayanth/react that referenced this pull request Jan 12, 2018
The TestUtils lost media events when they were pulled out of the
topLevelTypes constant. This commit adds them back by concatenating
the media event keys to the list of top level types.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants