Help with multiple calls to the same mocked module!
I'm trying to mock axios module using jest's mockResolvedValueOnce(). My component makes 2 calls to axios post (the second depend on the first). For the first call it returns the right value, for the second it gets undefined. Tried everything so far 😥...
Unsure how to mock call to Google Maps API
Morning :) I need to test a component which makes a called to the google maps API, so I want to mock out that functionality. Within the component render, I am calling the api, and then a method once the script loads. If I render this component in my tests, it will call the API,…
Is this right? JSDOM does not render CSS which means class names are useless
To be more precise, toggling classes will not affect the dom. This explains why toBeVisible will not work in this sandbox. It only works when the styles are inlined. https://codesandbox.io/s/github/pstephenwille/test-lib-plain-react
How can I test my component that is pulling data from a custom hook
I have Component A (connected component) that uses some values pulled of a custom hook. These values will tell the component what exactly to render (conditional rendering of children elements). Question is: How can I test Component A behavior, meaning, how can I change the…