-
-
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
Snapshot test fails when using React Native Picker and Picker.Item #1960
Comments
I have the same issue =/ |
For this you'll likely need to do something like:
|
@cpojer This doesn't work. If you do this, as suggested:
Then it says this about the Picker component:
If you try this:
Then you get this about the Picker.Item component:
|
In that case I'd do this:
|
Thanks! I ended up doing this:
Which works =) |
When I tried this, I got:
|
you should instead do this, actually:
|
Just curious, is it Jest's goal to support all the RN component out of the box? |
No. |
If you're getting this error after having tried some of the solutions here: It's because proptypes is no longer bundled with React. Just remove the |
@WilliamIPark is right, you should use this in the newest versions:
|
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. |
I have seen similar problems with other components, but couldn't find the right mock implementation for Picker.
My error:
My component:
My test:
Tried mocking it some way but didn't help. I could make it work with Picker.Item-s commented out.
The text was updated successfully, but these errors were encountered: