I've just started migrating from enzyme to react testing library on my project that uses material-ui. From what I understand, RTL queries the dom and the recomm
I am trying to test a dialog with react testing library. This dialog contains a form I render with react hook form. This form has a single field with some valid
I'm getting the ECONNREFUSED error and it looks like my msw server isn't catching my get request when I start a get outside of a React component (which shaves s
I am trying to test a component with jest and react-testing-library that contains a conditional to be displayed. export default function CloseCollaborator
Here is the component to test, its a DatePicker component: import { useState } from 'react'; import { useFormContext } from '../Form'; import Textbox from '../T
I have a created a hook as following: import { AxiosResponse } from 'axios'; import { DEFAULT_EXPORT_FILE_NAME } from 'constants'; import { useRef, useState } f
ImageSlider.tsx const ImageSlider = (props: INF_ImageSlider) => { const [idx, setIdx] = useState(0); const imgRef = React.createRef<HTMLImageEleme
the challenge am having is explained below Am trying to set a draft_id value after the submit-recipients data-testid is clicked. The beforementioned value is pa
I have this component, which uses react-chartjs-2 to render a Doughnut chart: const CompliancyChart = ({data}): JSX.Element => { ... return ( <Cha
I understand that React Testing Library has an example of testing with react router, but I couldn't get it to work (I think because I am using react router V6).
My test passes but has a console refrenceError: You are trying to access a property or method of the Jest environment after it has been torn down. Test: import
I have an ag-grid that contains different columns and column groups, as well as row groups. I am trying to test the DOM elements displayed in the row group usin
I'm using the Select component from patternfly and attempting to do a test that involves making changes to the selection. I feel like I'm in a catch 22 as I can
After updating to React 18 or creating a new React 18 app from create-react-app, when I run the yarn test command, it gives a console.error as a Warning for eac
I started a project in react and I implemented some tests (first time I ever did test) using jasmine and react-testing-library (they are not useful for the mome
I have several tests written with Jest and React Testing Library. They all mock fetch and use a userEvent.click call to fire a submit button which makes a fetch
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