-
Notifications
You must be signed in to change notification settings - Fork 50k
Add test case for getEventTarget #12755
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
Conversation
|
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed. If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks! |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
|
Dear lidoravitan, We are researchers working on identifying redundant development and duplicated pull requests. We have found there is a pull request: #11528 which might be a potentially duplicate to this one. We would really appreciate if you could help us to validate and give us feedback. Thank you very much for your time! Sincerely, Luyao |
|
@FancyCoder0 These comments are creating notification noise on the repository, could I please ask you not to continue this on the React repository? Thanks :-) |
|
Thanks for the PR! We have plenty of tests that use Maybe it might be worth it if we add a test for corner case like this? react/packages/react-dom/src/events/getEventTarget.js Lines 20 to 23 in 1047980
|
|
@gaearon Thanks for response! Sure I will change the PR by your comment to cover the corner case. and update soon :) |
|
@gaearon Updated. react/packages/react-dom/src/events/getEventTarget.js Lines 20 to 27 in 1047980
I hope to cover the whole file, so we should cover the first Branch,
But I can't find any behaviour that nativeEvent.target will be undefined or null without a call directly to getEventTarget function and pass nativeElement.target undefined or null. I found something related to fake event, but still can't modify the event.target to undefined. react/packages/react-dom/src/test-utils/ReactTestUtils.js Lines 46 to 49 in 8227e54
|
|
@gaearon @sophiebits |
|
@gaearon, please can you check this PR ? thanks. |
| }); | ||
|
|
||
| // Normalize SVG <use> element events #4963 | ||
| it('get target element object in case the target has correspondingUseElement property', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I disable correspondingUseElement logic in getEventTarget.js this test still passes. Seems wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gaearon I agree that was wrong, so i fixed that. please review again.
thanks :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gaearon hope you can review this PR again, thanks
… PR change requests
…seElement elements
|
@gaearon @sophiebits Please can you take a look, thanks! |
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution. |
|
@gaearon is it could be relevant? or close this PR? btw, I fixed this PR by your comment. |
|
Hey, thanks for PR. Looking at it again, I'm not sure it adds anything in practice that isn't already covered by other tests. So we probably don't need it after all. Sorry for the churn. The SVG case is interesting, but it's clear enough from the source code itself so if we ever decide to remove this special case, the test won't help us much. |
Added Test case for packages/react-dom/src/events/getEventTarget.js