-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Component created using React.memo appears as "Component" in snapshot #8122
Comments
That's odd, that was supposed to be fixed in Does it get the correct name in React devtools? I wonder if |
Thanks for the quick response @SimenB. It did not, in fact, appear on React Dev Tools (it appears as However, when I write:
It does appear on React Dev Tools: But the snapshot remains the same. |
Interesting! Could you put together a minimal reproduction that renders correctly in chrome devtools but not in Jest? |
I've created this repo here: Please let me know if there's anything missing |
Thanks! That repo uses Jest 23 - we added support for |
Ty for the heads up. I've upgraded the dependencies. Can you please check again? |
Oh this uses That said, I debugged a bit, and the bug appears to be in I'm not sure how this is supposed to work: https://github.com/adriantoine/enzyme-to-json/blob/df30a5ace977c97fb42a6164a9f47af618ccf368/src/utils.js#L38-L54 Changing all the
So yeah, this is a bug in either |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
🐛 Bug Report
To Reproduce
A clear and concise description of what the bug is.
Hello,
When, I have the following components:
And test
App.jsx
with the following:I get the following snapshot:
Expected behavior
As you can see, where I was expecting something like
memo(MainMenu)
, I'm getting<Component />
.What's worse is, that if I replace the render in App to, instead of using
<MainMenu />
, to use another memoized component, the snapshot will still pass because it won't notice the difference.Run
npx envinfo --preset jest
Paste the results here:
The text was updated successfully, but these errors were encountered: