-
Notifications
You must be signed in to change notification settings - Fork 92
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
Popover is not testable in react-native-testing-library #159
Comments
@myou11 I checked out this issue and if you're trying to test the basic popover functionality, I was able to test that. Something like, render component, test that popover content doesn't exist, click button, test popover content does exist. I didn't have to mock anything, it looks like. I'm still on ETA: I did wrap my component in |
Thanks for trying it out @ginnymin! I must have something wrong with my local config so I'll have to try again when I get some time. It's good to know you can query for the contents of your modal in your test though, so I know it's possible! |
Currently I'm running into this same problem |
@myou11 , I used an example where you were trying to mock the UIManager and got it to run successfully (note, I am using TypeScript)
|
After mocking the UIManager (thanks to @myou11 & @tysoc1222) I still ran into the ref.current being null problem. Adding Hope this helps :) |
I have exactly the same problem. |
Describe the bug
I am trying to write a test where I press a button that then shows a Popover. I receive this error when pressing the button to show the popover:
It seems like I might need to mock the
NativeModules.UIManager
, so I referenced this post to do so.This then leads to this error:
At this point, I'm not sure how to fix the mock to allow the test to succeed. Can someone who has successfully tested this popover with react-native-testing-library please offer me some advice on how to correctly test this Popover please?
Device/Setup Info:
react-native
version: 0.71.3react-native-popover-view
version: 5.1.7The text was updated successfully, but these errors were encountered: