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

Make sure simulated events don't warn when providing extra event properties #6380

Merged
merged 1 commit into from
Apr 6, 2016

Conversation

zpao
Copy link
Member

@zpao zpao commented Mar 30, 2016

fixes #6379

@zpao
Copy link
Member Author

zpao commented Mar 30, 2016

I think in an ideal world we'd be using the right SyntheticEvent subclass constructor for the event. This would allow us to set the properties directly on the fakeNativeEvent before passing it to the constructor, then all the appropriate properties would be copied off fakeNativeEvent (Eg, a click event would go through SyntheticMouseEvent and look at the MouseEventInterface which includes clientX). This would require more work though so I didn't want to get into it now.

@@ -474,6 +474,29 @@ describe('ReactTestUtils', function() {
expect(handler).not.toHaveBeenCalled();
});

it.only('should not warn when simulating events with extra properties', function() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

.only

@gaearon
Copy link
Collaborator

gaearon commented Mar 30, 2016

Re: ideal world, relevant to #6154.

@facebook-github-bot
Copy link

@zpao updated the pull request.

@zpao zpao added this to the 15.0 milestone Mar 31, 2016
@facebook-github-bot
Copy link

@zpao updated the pull request.

@zpao
Copy link
Member Author

zpao commented Mar 31, 2016

Hmm, worth noting that this silences an expected warning (easier to see now on travis now that other issues are cleaned up). I'll look into that some more…

@facebook-github-bot
Copy link

@zpao updated the pull request.

@zpao zpao mentioned this pull request Apr 5, 2016
15 tasks
@sebmarkbage
Copy link
Collaborator

Is the travis test error relevant? Looks plausible.

@zpao
Copy link
Member Author

zpao commented Apr 6, 2016

Nope, that's because of #6228. Will take a closer look at that test (only failing in non-createElement mode) in the morning but this should be fine.

@jimfb
Copy link
Contributor

jimfb commented Apr 6, 2016

👍

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.

ReactTestUtils.Simulate logs unexpected console error
5 participants