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

Fix pretty-format to respect displayName on forwardRef. #9422

Merged
merged 2 commits into from
Jan 17, 2020

Conversation

DiZy
Copy link
Contributor

@DiZy DiZy commented Jan 16, 2020

Summary

Unlike React DevTools, Jest ignores a custom displayName set on forwardRef components. We should align serialization with DevTools, so change the behavior.

Test plan

Created a new unit test to cover the changes.

CC @scotthovestadt @bvaughn

Unlike React DevTools, Jest ignores a custom displayName set on forwardRef components. We should align serialization with DevTools, so change behavior.
@facebook-github-bot
Copy link
Contributor

Hi DiZy! 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 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 to sign the corporate CLA.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@scotthovestadt
Copy link
Contributor

Changelog, and this should go in major release.

@codecov-io
Copy link

Codecov Report

Merging #9422 into master will increase coverage by 0.02%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #9422      +/-   ##
==========================================
+ Coverage    64.8%   64.83%   +0.02%     
==========================================
  Files         281      281              
  Lines       12000    12002       +2     
  Branches     2960     2961       +1     
==========================================
+ Hits         7777     7781       +4     
  Misses       3591     3591              
+ Partials      632      630       -2
Impacted Files Coverage Δ
packages/pretty-format/src/plugins/ReactElement.ts 92.3% <100%> (+5.82%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c8c4c4e...5d27d34. Read the comment docs.

@SimenB SimenB merged commit 7ee717d into jestjs:master Jan 17, 2020
@SimenB
Copy link
Member

SimenB commented Jan 17, 2020

Sorta related: #7460 - do you think that's needed?

@scotthovestadt
Copy link
Contributor

@SimenB No, that's not using react-is so I think this is good as-is.

@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants