Skip to main content
New: Stack Overflow For Agents. The next generation of knowledge exchange. Learn more
Filter by
Sorted by
Tagged with
3 votes
1 answer
77 views

I'm trying to learn how to use react-testing-library and having trouble getting started with some of my components. I keep receiving the error in the title, pointing at custom API hooks in the file. ...
npfist's user avatar
0 votes
0 answers
72 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
0 votes
1 answer
88 views

I have a component like this to test: import {doSomethingMocked} form 'mockedLibrary'; const TheComponent = (props) => { const [isToTest, setIsToTest] = useState(false); const handleClick = ...
Daniel Reinaldo Zorro Forero's user avatar
-1 votes
2 answers
2k 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
-1 votes
1 answer
702 views

I am experiencing an issue after upgrading to React-Router version 7.6.2. I was able to replicate the failure: StackBlitz. Note that this test passed when I had v6 of React-Router-DOM. The problem ...
Zlatan Sadibasic's user avatar
0 votes
1 answer
349 views

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

I'm wondering if it's better to use findBy together with rejects.toThrow instead of using queryBy with not.toBeInTheDocument when checking that an element is not displayed in cases like the following. ...
Ken's user avatar
0 votes
1 answer
55 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
1 vote
1 answer
188 views

Using NextJS 14 and react testing-library, we previously used to test client components and client-only pages that take dynamic URL parameters like this: type PageProps = { params: { date: string }...
James Crowley's user avatar
1 vote
0 answers
115 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
0 votes
1 answer
242 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
43 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
1 vote
1 answer
120 views

While learning React, I'm trying to understand custom hooks. I've created a simple one updating an internal "step" on creation, cleanup, and allows for external updates. But I'm struggling ...
Dgurio's user avatar
-2 votes
1 answer
132 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
0 votes
1 answer
60 views

I'm stuck on a validation scenario in my Nextjs app, I have a form with some inputs and when a user tries to submit an invalid form an error message should be shown in the form. However I think there ...
jordan's user avatar

15 30 50 per page
1
2 3 4 5
…
248