Skip to main content
Filter by
Sorted by
Tagged with
1 vote
0 answers
66 views

I'm trying to write tests for my React Native app (using TypeScript). All my unit tests pass without issues, but when writing component tests, I encounter the following error: ● ButtonComponent › ...
shirxz's user avatar
  • 11
2 votes
0 answers
278 views

I'm facing an issue where my test fails to find an element by text after I added the Select UI component from gluestack-ui to my React Native component. Before adding the Select, my test works fine: ...
Loann Delgado's user avatar
0 votes
0 answers
144 views

I am writing Jest tests for my react native application. When I use user.press function, I get the following error: Unable to find node on an unmounted component. at findCurrentFiberUsingSlowPath (...
Nowhereman's user avatar
-1 votes
1 answer
302 views

Getting error when using the render method to test component `Trying to detect host component names triggered the following error: Unexpected token 'export' There seems to be an issue with your ...
Prajwal VK's user avatar
0 votes
1 answer
220 views

When I test component containing TouchableOpacity with React-Native testing library, first time render is ok, second time in test suite test always fails. If I replace TouchableOpacity with ...
Tetiana Hrynko's user avatar
0 votes
2 answers
683 views

I have a simple component with two inputs and one button. I was able to test the code with getAllByRole func for buttons. But when I want to find input elements, I got below error : Unable to find an ...
Obtice's user avatar
  • 1,277
3 votes
1 answer
5k views

Hello I'm testing my app with react-native-testing-library. When i run test returning test fail How can i solve this? Error is: Can't access .root on unmounted test renderer There seems to be an ...
mehmettalhairmak's user avatar
0 votes
2 answers
901 views

Test Case: it("Test Email text by test id" , () => { const testIDName='email-title'; const {getByTestId} = render( <Provider store={store}> <NavigationContainer><Login /&...
Om Bandiwan Omy's user avatar
0 votes
1 answer
172 views

I need help figuring out how to mock an axios post request. The docs have failed me. I've tried just about every combination I could find on stack overflow. All end up with either typescript errors or ...
Fiddle Freak's user avatar
  • 2,137
0 votes
1 answer
263 views

I do some unit testing, here is my code: import React from 'react'; import { render, fireEvent, act, waitFor } from '@testing-library/react-native'; import { LoginScreen } from '../login.screen'; ...
Yanhamu's user avatar
  • 31
1 vote
1 answer
580 views

I am trying to test my toast component (uses react-native-reanimated under the hood) using react-native-testing-library but when I try to show my toast the ref is null. I cannot understand why: This ...
Pakenfit's user avatar
  • 200
1 vote
0 answers
1k views

I am trying to unit-test my flatlist to make ure a view pops up once the flatlist has scrolled a certain amount of distance. My flatlist looks like this: <FlatList testID={LIST_OF_TRANSACTIONS}...
Hardik3296's user avatar
0 votes
1 answer
387 views

I get this error when I try to install react-native-testing-library (using expo for my project), which tells me I need react@>=16.8.0, but I have [email protected], so shouldn't this be fine? Am I ...
Yash117's user avatar
  • 53
2 votes
1 answer
883 views

Can anyone confirm whether the user-event library is compatible with React Native Testing Library? I'm guessing not, as the user-event docs say the library can be used with any framework as long as ...
Andrew's user avatar
  • 5,511
0 votes
1 answer
646 views

I have tried to write test case using jest as matcher and React NativeTesting library as a test base. But I can't reach the 100% test coverage. I have tried to mock the use effect and use state hooks ...
Balaji Govindaraj's user avatar
1 vote
0 answers
37 views

LoginScreen.test.js import { Text } from 'react-native'; it("Login_Screen_should_render_correctly", () => { const { toJSON } = render(<Text >hey</Text>) ...
Ajay Pandey's user avatar
  • 1,008
0 votes
2 answers
83 views

I want to query an element through jest which is conditionally rendered. The component is rendered after loading state is set to false when Api call is complete. There are ways to query elements which ...
Ali Ibraheem's user avatar
0 votes
1 answer
34 views

Suppose I have a component that loads its content when an asynchronous call returns succesfuly: const MyScreen = () => { let userData: userDataResponse; const [email, setEmail] = useState("...
Rafael's user avatar
  • 2,749
3 votes
1 answer
2k views

I have a react-native FlatList component with onEndReached event used to load more items. I am testing the component with react-native-testing-library. The test is as follows: Component mounted. ...
Elolawyn's user avatar
  • 183
1 vote
2 answers
2k views

I'm building a React Native app. Within my GigsByDay component, there is a TouchableOpacity element which, when pressed, directs the user to a GigDetails screen. I'm trying to test this particular ...
Josh Simon's user avatar
0 votes
1 answer
308 views

I am trying to do screen testing with react native while mocking the api responses with Nock. After a call to the api my component is supposed to display some text fields. It works on the app but I ...
Antoine Grenard's user avatar
2 votes
1 answer
407 views

I'm building a live music gig listing app in React Native with expo. An array of gig objects is fetched from firebase, with the following shape: gigs: [ { dateAndTime:{seconds:2345234748}, ...
Josh Simon's user avatar
-1 votes
1 answer
852 views

A react native 0.70 component displays items in FlatList. The array items is a state and is assigned value in hook useEffect. I would like to jest (0.29) it to see if a item's name is shown up on ...
user938363's user avatar
  • 10.3k
1 vote
1 answer
474 views

Trying to use Jest with ESM configuration to test React Native components and getting errors that Jest can't parse the imports from 'react-native'. The errors look like this: SyntaxError: The ...
nerdlinger's user avatar
  • 2,236
2 votes
2 answers
7k views

I am running a test for a component that needs to check if it has a particular CSS style. As the React Native Testing Library doesn't have this function by default, I installed the @testing-library/...
dnd1993's user avatar
  • 161