I just can't figure out, how I'm supposed to mock / get data from scrollHeight, scrollWidth, clientHeight and clientWidth in test. For better introduction, my t
I'm trying to upgrade my project to React 18, everything works in dev and production mode in the browser. But after upgrading to the latest version of @testing-
I am using act function from library https://testing-library.com/docs/react-testing-library/intro/. At this point I have something like this: await act(async (
I'm quite newbie for the testing library. I already find out how to test the span appearance with the element but seems there's no answer of it. I have an examp
I am trying to unit test my function that call useQuery from @apollo/client. Here's what I have done getPixelID.ts import { useQuery } from '@apollo/client'; im
I have an svg inside a React component that renders conditionally. <div className='avatar'> {gender === true ? <MaleAvatar /> : <FemaleAvat
I have below listener added for which I am trying to write test using Jest. However, it seems as though the event I'm dispatching doesn't reach my code. window.
I have a TextArea component that takes JSON {"someKey": "someValue"}. When I inspect the dom, {"someKey": "someValue"} shows up just fine in the inspector. Howe
I have a small problem with act() error in react-testing-library. In useEffect I try to call an function that is a promise. Promise returns some data and displa
I'm trying to test an Info HOC on my react app : const InfoHOC = (HocComponent) => ({ message }) => ( <> <Tooltip title={message}>
I am trying to write a few simple tests that the headers and data I want to render are showing up as expected. I created a repo - https://github.com/olore/ag-gr
I created this useHover hook: import { useRef, useState, useEffect } from 'react'; export const useHover = () => { const [value, setValue] = useState(fals
I just downloaded Create-React-App which uses react testing library. I do not get intellisense when I use it's methods (Example : toBeInTheDocument) . How to se
I can successfully implement a test with React Testing Library's fireEvent method, but when I try equivalent tests with userEvent I can't get it to trigger anyt
I was struggling with a test issue for my custom useLazyQuery hook. My first test is passing but the second one is failing. What am doing wrong for the second t
I'm trying to mock axios.create() because I'm using its instance across the app and obviously need all of its implementation which is destroyed by the mock, thu
I'm using react-router V6 and trying to test the new feature of useOutletContext. my testing library is testing-library/react and I'm not sure how to pass the C
I need some help. I'm a newbie in apollo client reactive variables. There is a component where the displaying of the message depends on a variable that values f
so I am trying to test that the onSubmit function is getting triggered if the button is clicked - the way im doing this is through testing the internals of the
The popup has a click away listener which closes it when a click event occurs outside the component. I need to test that the popup has closed. it.only('clicking