close
Skip to main content
Filter by
Sorted by
Tagged with
0 votes
2 answers
4k views

I'm encountering an issue while testing a React component using React Testing Library. The component involves fetching data using Axios. The tests fail with the following error: TypeError: Cannot ...
Ruffyg's user avatar
  • 113
0 votes
1 answer
322 views

Prompt.js import { unstable_usePrompt as usePrompt } from 'react-router-dom'; // eslint-disable-next-line react/prop-types export default function Prompt({ when, message }) { usePrompt({ when, ...
Alexei Delezhov's user avatar
0 votes
1 answer
73 views

I want to test the Sidebar component. When you click on the "ToggleButton" it should toggle sidebar by className, but when clicking, an error appears stating that the function was not found.....
zzloyshkolnik's user avatar
1 vote
0 answers
139 views

I have a custom function that show a user's card (returns JSX.Element) when the pointer is over the user's name. This component request user information using React Query, which I use for data-...
Danil Parkhomenko's user avatar
1 vote
1 answer
1k views

After Updating my react native version, I am keeping getting errors when I run the jest tests, it is regarding the snapshot tests for react redux connected components React: 18.2.0 React Native: 0.72....
Zijian's user avatar
  • 227
0 votes
0 answers
139 views

i try to write test for project in react-native for snapshot testing but when i run it always get error Error: Element type is invalid: expected a string (for built-in components) or a class/function ...
Sootood Ebrahimi's user avatar
3 votes
1 answer
143 views

I'm struggling to get my 2nd React test to pass. Here is my App.js file: import logo from './logo.svg'; import './App.css'; import {useState} from 'react'; import {Link, Route, Routes} from "...
Roblou's user avatar
  • 35
2 votes
1 answer
756 views

Try to snapshot a Logo component but got an error that is not properait as far as i understand. Pleas help! logo.test.js import TestRenderer from 'react-test-renderer'; import Logo from '../components/...
A.B's user avatar
  • 83
1 vote
2 answers
142 views

I have a react native component OrdersScreen which I am not able to test because the component gets updated when setState : setRenderLoader(false) is called in React.useEffect() hook. const ...
cooltogo's user avatar
0 votes
0 answers
2k views

My Dashboard component which is the parent component of the TopCards component which in turn is parent component of the Card1 Component import TopCards from "./Dashboard/TopCards"; const ...
Prince Singh's user avatar
2 votes
0 answers
195 views

I am troubleshooting a failing React unit test that uses TestRenderer from react-test-renderer. My component queries a rest endpoint using GraphQL via the useQuery hook. If I wrap my component with &...
engineerKev's user avatar
2 votes
1 answer
2k views

The current setup is React 18 with the current versions of webpack, babel, typescript, jest & using the MaterialUI component library. Running/building the application produces no error & the ...
Andrew Pavlick's user avatar
2 votes
2 answers
2k views

I have an npm monorepo which contains web apps (React 18), mobile apps (React-Native 0.71/React 18) and shared libraries. I am also using npm overrides to fix React versions, this has not changed. ...
tallpaul's user avatar
  • 1,573
3 votes
0 answers
235 views

I'm trying to write a snapshot test for one of the component in my app. The component is built with some Antd components like Select. i get the following error. The tests import React from 'react' ...
Vignesh s's user avatar
  • 348
0 votes
1 answer
1k views

I'm trying to do unit tests using react-test-renderer and I can't seem to make the test pass even though the underlying component I'm testing works. Can someone tell me what I'm doing wrong This is ...
MusclesInstalling's user avatar

15 30 50 per page
1
2 3 4 5
11