Skip to main content
Filter by
Sorted by
Tagged with
0 votes
0 answers
58 views

I'm testing a Backstage plugin component that renders a list of Ansible components using the Backstage Table from @backstage/core-components. In my test, I mock the catalog API to return 2 entities (...
Pavan P Jangale's user avatar
-1 votes
2 answers
459 views

I am new to Next.js but not to React and Jest; this is the first test suite I'm setting up in Next.js. I have the following (extremely minimal, but this example does cause the error) component I am ...
cdyswnnr's user avatar
0 votes
1 answer
182 views

I have the following hook: function useWelcomeMessage() { const { data, error} = useGetWelcomeMessage(); const printMessage = useCallback(async () => { if (data) { alert(data) ...
Mark's user avatar
  • 2,031
0 votes
1 answer
45 views

I am testing my Input element by 2 way. adding value and click on button to "todo list" works fine adding value and enter the "input' field, but throws error. I am seeking ...
3gwebtrain's user avatar
  • 15.5k
1 vote
0 answers
87 views

I know that this is a well trodden topic, but most of the articles and help topics on this talk about how to avoid, and don't actually detail what exactly causes it. I have a simple example of how we ...
dwjohnston's user avatar
  • 12.5k
0 votes
1 answer
193 views

I'm building a NextJS (react) app with Chakra UI (version 3). I'd like to write unit tests, but I don't know to handle the way Chakra UI v3 handles select. Here's a sample test app: 'use client'; ...
John Tang Boyland's user avatar
0 votes
0 answers
35 views

how to write unit tests for useUpdateTodo hook without mock useGetUserId // Get the user const useGetUserId = ()=>{ const { data: user } = useQuery({ queryKey: ['user', email], queryFn: ...
StanStanStan's user avatar
-2 votes
1 answer
84 views

After a lot of trial and error I cannot get RTL to render any components from react-router-dom. I am using [email protected], @testing-library/[email protected], @testing-library/[email protected], react-router-...
rdn's user avatar
  • 1
0 votes
0 answers
116 views

I'm currently writing UTs using vitest & react-testing library for my Next.js 14 application and I'm facing issues with the usePathname hook from next/navigation. The usePathname hook is returning ...
Prajwal Kulkarni's user avatar
1 vote
1 answer
74 views

Earlier I was using NextJS 12 version & we stop generating the dynamic CSS class while writing the snapshot in React Testing Library by using the below method: mocks\styled-jsx\css.js function css(...
Nishant Pandya's user avatar
-2 votes
1 answer
55 views

Using @testing-library/react": "^16.0.1", I would like to know the correct approach to handle my current scenario. Here is my filter pane [using from Material UI filter slot similar to ...
3gwebtrain's user avatar
  • 15.5k
1 vote
0 answers
42 views

I have a simple Jest snapshot test, and upon failure, I would like to print a custom error message to remind the developer that if they intentionally failed the test, they need to ensure they update ...
Attila's user avatar
  • 1,177
0 votes
0 answers
36 views

I am displaying a loading indicator whilst I wait for an async process to occur, however I believe my test might be missing it being displayed because the async process is too quick? const [isLoading, ...
physicsboy's user avatar
  • 6,466
0 votes
0 answers
32 views

This is simple App.jsx import React, { useState } from 'react'; const App = () => { const [showDialogue, setShowDialogue] = useState(false); const handleButtonClick = async () => { ...
Trinu's user avatar
  • 1,759
1 vote
1 answer
673 views

I'm working on a React app that is tested with jest, and so far things have been going well. I have a component that relies on a service that shuffles a deck of cards. The component relies on this ...
Surfdaweb's user avatar
0 votes
0 answers
59 views

I am having an issue running tests with jest and RTL. In my jest.config.js I have this: const config = { transform: { ".*": "babel-jest", "^.+\\.(gql|graphql)$":...
CodeConnoisseur's user avatar
0 votes
0 answers
26 views

I'm using Jest with Testing Library on TypeScript. When I try to use the render function (from Testing Library) to load a component with this type of import, for example: import backgroundImage from '@...
João Périco's user avatar
0 votes
0 answers
41 views

Im trying to setup tests for my company's app. The app runns perfectly, but when i run tests i get the following error: Cannot find module @myCompany/custom-react-components from 'src/contentArea/...
Admir Husić's user avatar
0 votes
0 answers
39 views

I am using NextJS with React Testing Library for component testing. I have a tinymce editor that loads from a CDN. When I tried to render my component which contains the tinymce component with React ...
Chris's user avatar
  • 3
1 vote
1 answer
825 views

import { render, screen, waitFor } from '@testing-library/react'; import React from "react"; import { createMemoryRouter, RouterProvider, Outlet, createBrowserRouter } from 'react-router-dom'...
NAVEED's user avatar
  • 127
0 votes
0 answers
36 views

I have a NumericFormat as part of a react-hook-form Controller which vitest renders with jest-dom. When trying to enter some test data into it, its value does not change. The Component: // ...
onouv's user avatar
  • 640
-1 votes
1 answer
366 views

I am introducing tests into my project and the thing I've encountered is that when I test the whole page component MUI X Data Grid table gives a wall of errors making it almost impossible to ...
magrega's user avatar
  • 263
0 votes
1 answer
62 views

My components are working correctly, but I need to build snapshot tests for my react project, and I can't because of this error. My data tests are running correctly. Login.jsx import React, { useState ...
Joo Victor de Aquino Netto Pac's user avatar
2 votes
0 answers
1k views

I'm creating a utility package that exports multiple tools like eslint, playwright, vitest, react testing library etc, and I'm using rollup to bundle the package. However, when I install this package ...
Prajwal Kulkarni's user avatar
0 votes
1 answer
256 views

After going crazy around a test that refuses to pass, I realized that the Select component in the Antd library does not handle more than 2 options. I wrote the following test to explore the issue: ...
user2921009's user avatar

1
2 3 4 5
75