-
Notifications
You must be signed in to change notification settings - Fork 54
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
How to mock <Wrapper /> ? #656
Comments
If you would like to upvote the priority of this issue, please comment below or react with 👍 so we can see what is popular when we triage.@testrobpoc Thank you for opening this issue. 🙏
This is an automated message, feel free to ignore. |
+1 |
It's a bit tricky since the google maps API will typically not be available in your tests. For that, but you can use googlemaps/js-jest-mocks to some extent. As for the status, you'd need to mock the Lines 74 to 86 in 5bf3929
|
For anyone else who is looking for a solution, here is what worked for me:
Hopefully that helps someone. |
@localjo 's answer should be in docs. |
Hey,
I am completely lost on unit testing using Jest.
Basically, does anyone know how to mock in order to render child component in unit tests?
The thing is, always have Status of loading, and it never goes to Success, so the child component is never rendered. Is there a way to mock that Status to Success?
I'm using jest, and react-testing-library.
Thank you.
The text was updated successfully, but these errors were encountered: