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

Simulate synthetic events using ReactTestUtils #939

Merged
merged 3 commits into from
Feb 19, 2014

Conversation

sophiebits
Copy link
Collaborator

Most of the time this is what you want to do, so I've renamed what was Simulate to be SimulateNative.

Now Simulate.change does what you expect, so this fixes #517 and fixes #519.

Includes/depends on #937.

@sophiebits
Copy link
Collaborator Author

/cc @chenglou @yungsters. Looks like we should probably be recreating ReactTestUtils.Simulate whenever a new event plugin is injected. Ideas for a clean API for doing so?

@zpao
Copy link
Member

zpao commented Jan 21, 2014

I like. Suggestions for changing internally? I'm guessing we could just codemod existing callsites to be SimulateNative.* and move on, though we may want to do a pass and see if some of those should be testing the synthetic.

@sophiebits
Copy link
Collaborator Author

My guess is few or none of the existing callsites should be using SimulateNative; simulating native events is useful when testing React itself or event plugins but otherwise I don't think it should be needed. If you send me more info about any failing tests, that would be helpful -- it seems likely that there are changes that could be made to this code.

Most of the time this is what you want to do, so I've renamed what was Simulate to be SimulateNative.

Now Simulate.change does what you expect, so this fixes facebook#517 and fixes facebook#519.
chenglou added a commit that referenced this pull request Feb 19, 2014
Simulate synthetic events using ReactTestUtils
@chenglou chenglou merged commit e13977c into facebook:master Feb 19, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants