-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Unexpected snapshot written when using react-native v0.56.0 #1743
Comments
You'd need a react native adapter to reliably use enzyme with React Native (see #1436). enzyme also doesn't support snapshots (but Can you share the output of |
The test using
With react-native 0.55.4 the snapshot is
with react-native 0.56.0 it is
|
I'm confused; if it's changing as react-native changes, that's an issue with react-native (and one a react-native adapter could handle). What's changing as enzyme changes? |
Could this be related to #1539 ? The reflection from reconciler is out of sync with the dom generated from react-native? |
@corintho it's entirely possible. Either way, using enzyme with react-native without a react-native-specific adapter is always going to have quirks. |
Closing for now; happy to reopen if needed. |
@rajapanidepu there's no fix I'm aware of; without a react-native adapter, enzyme doesn't currently support react-native. If someone were to create one - whether in this repo, or separately - then that would be the path for addressing any issues. |
@rgal75 I'm experiencing this same issue with react-test-renderer/shallow. I began experiencing this after upgrading to MacOS Mojave for Xcode 10 for iOS 12 support. I was then forced to upgrade React and React Native for compatibility with Xcode 10. Apologies for posting in Enzyme repo, but this is the only ticket I've found regarding this issue. I'm hoping they are related. Below is my package.json with new changes on the right side. Changes to the Dev Dependencies is the result of me hacking away at broken Jest tests after upgrading main dependencies. And this is my |
We're facing the exact same issue where calling Encountered this initially when trying to upgrade from RN 0.55 to 0.57. We thought it was due to the Do we have to hold off on upgrading RN entirely until enzyme comes up with a proper RN adapter? And is there even a roadmap for that? We will probably hold off upgrading for now but we really want to upgrade our RN version by the end of this year and we're not sure whether this issue will be properly resolved by then. Maybe we will have to end up switching to |
@tjjjwxzq it's unlikely we'll be able to devote any roadmap time to developing a react-native adapter, since airbnb no longer uses RN. However, if a community member submitted a PR, I'd be more than happy to help review, and update the branch when possible, to get it into a shippable state. |
@ljharb I see. Thanks for the quick response! 😃 |
@tjjjwxzq @AndrewHenderson @rgal75 I think this might actually be an issue with React Native itself: facebook/react-native#21937 |
Still an issue for me :( - RN 0.57.0 |
Also same issue for me RN 0.57.8 |
Describe the bug
Having upgraded the react-native dependency in an app from 0.55.4 to 0.56.0 caused
shallow
to produce a different snapshot. With 0.56.0 the snapshot only contains<Component>
tags instead of specific<View>
,<Text>
, etc. tags.To Reproduce
Steps to reproduce the behavior:
react-native init
enzyme
(and some more) as a dev dependency. The resultingpackage.json
isApp.test.js
):<Component>
tags:Expected behavior
The snapshot should be similar to:
Screenshots
none
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: