menu
Channels
Chat
view-forward
# All channels
view-forward
# General
view-forward
# General Help
view-forward
# Angular Help
view-forward
# Cypress Help
view-forward
# DOM Help
view-forward
# React Help
view-forward
# Svelte Help
view-forward
# TestCafe Help
view-forward
# Vue Help
view-forward
Team
Posts
Members
Info

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 馃槬...

thumbsup
0
message-simple
1

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,鈥

thumbsup
0
message-simple
7

How to distinguish between matched items?

I'm matching quite a few items by text. What's the best way to identify the item I want to click vs just display text? A user can visually identify a left nav or header nav but I'm not seeing a way to code that in the tests.

thumbsup
0
message-simple
2

How to test element is focused

I would like to know if an input I have is focused when another element is clicked... How would I do this? Eg: https://codesandbox.io/s/616nl7q2pk

thumbsup
0
message-simple
6

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

thumbsup
0
message-simple
2

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鈥

thumbsup
0
message-simple
2

multiple forms in react hooks

Hi, Background : I have a react page developed using "React Hooks", which has multiple fields that are replicated across the page. 鈥

thumbsup
0
message-simple
7

Link some larger Open Source projects that are using the testing-library

I think the examples are fine but I've still got many unanswered questions and the only way to convince me would be some working examples. Thanks in forward :)

thumbsup
0
message-simple
6

What do you think of react-testing-library?

I wrote react-testing-library to allow our tests to better resemble how users interact with our components so we can get more confidence in our code. I'd like to hear how people think that goal has worked out for you.

thumbsup
0
message-simple
46