Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
282 views

I tried everything but still for some reason the react state doesn't change, what is I am missing or what is the alternative approach? Code: export const useCounter = (): UseCounterResult => { ...
mehran's user avatar
  • 1,494
0 votes
2 answers
921 views

I'm using a custom react hook to perform two GET operations using react query. The API is in a separate module and uses both getTestByUid() and getTestStatuses() inside useQuery. // TestHook.js import ...
Tony96's user avatar
  • 41
1 vote
0 answers
399 views

I am using the React renderHook() function to call a custom hook. Internally in the custom hook, I call a function that executes axios, gets data and on success, dispatches a state change to a custom ...
Quinton's user avatar
  • 11
0 votes
0 answers
301 views

I've created a widget component that can be embedded on a webapp as a script. It is not embedded in an IFrame therefore lives inside the webapp's window object. This embedded component is responsive ...
glengomerson's user avatar
1 vote
1 answer
354 views

I have a custom hook that downloads a file from an url, it works fine and now I trying to test its behaviour. const useFileDownload = ({ apiResponse, fileName }) => { const ref = useRef(null) ...
heliosk's user avatar
  • 1,169
0 votes
0 answers
290 views

I have this function inside a helper: export const useDAMProductImages = (imageId: string) => { const { app: { baseImgDomain }, } = getConfig(); const response: MutableRefObject<...
BlackWhite's user avatar
0 votes
0 answers
1k views

I'm trying to test a custom hook but for some reason I can't render the hook inside the test closure "it". This code works (I must use the rerender methods otherwise the result.current.data ...
jeyremd's user avatar
  • 309
1 vote
2 answers
3k views

Here is touchable element with navigation.navigate (react navigation 6.x), export default Home = ({ navigation }) => { .... return ( <TouchableOpacity testID={"...
user938363's user avatar
  • 10.3k
1 vote
1 answer
2k views

Im learning react testing and i have this hook i want to test but i have no idea how import { useState, useCallback } from 'react'; import axios from 'axios'; export const useFetch = () => { ...
ludinj's user avatar
  • 125
-1 votes
1 answer
313 views

I do not understand why the state is registered yet it does not have an effect to the intended value of beds. Here is the main component const options = ["1", "2", "3"]; ...
lemu's user avatar
  • 64
1 vote
0 answers
2k views

I'm trying to migrate the test framework of my app from Jest to Vitest (for multiple reasons) and I encounter an issue. With Jest, I was using runtime request handlers at multiple places of my app to ...
Yomansk8's user avatar
  • 243
0 votes
2 answers
534 views

Trying to install "react-google-login" by using the command npm install react-google-login. It gives the following error : npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve ...
Prajwal Raj's user avatar
2 votes
1 answer
181 views

react won't work when rendering the page, but when i changed code in the vscode (added a line of console or comment one line out), the page is rendered. or when page is not rendered. when i hit ...
gongonlittle's user avatar
1 vote
1 answer
1k views

I need your help on fixing the test case. I am trying to mock the document body offsetwidth, offsetLeft objects. In the resize method, I am trying to mock the newWidth which is calculating the mouse ...
user901916's user avatar
4 votes
2 answers
9k views

I wanna test a custom hook with react-testing-library therefore, I add this code into beforeEach: let renderedHook ; beforeEach(() => { renderedHook = renderHook(() => useFetch()); }); test('...
Martin Rützy's user avatar

15 30 50 per page
1
2 3 4 5 6