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
0 votes
0 answers
34 views

I am trying to test an input value in my form, my form also contains a drop down list component - I keep getting the warning: Warning: Function components cannot be given refs. Attempts to access ...
Bomber's user avatar
  • 11.1k
2 votes
0 answers
284 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
2 votes
0 answers
126 views

I have been facing two issues mainly console.error Warning: React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but ...
Shoyeb Memon's user avatar
  • 1,159
0 votes
0 answers
147 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 vote
0 answers
213 views

I want to running jest to test my component, I'm using React Native Testing Library to test and React Native Web to create an example. Whenever I tried to run jest I facing an error like this: ● Test ...
flix's user avatar
  • 1,983
-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
506 views

I have a React Native component with a TextInput that I'm testing. Part of the behaviour of this component relies on handling the current selection position via onSelectionChange — that is, it matters ...
Autumn Leaf'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
2 votes
0 answers
934 views

We just recently did a React Native upgrade to 0.72.4 on our project and therefore updated the versions of the testing libraries as well. These are the versions they're at right now: Relevant ...
Rameez Hussain'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
4 votes
1 answer
2k views

I have setup testing in my react native app with typescript using React-native-testing-library. I have configured my babel,config.js as below. There is an odd issue though. module.exports = { ...
Jason Byron Beedle's user avatar
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
1 vote
1 answer
320 views

I have a few questions about react-native-testing-library. I want to implement unit tests on my app by using react-native-testing-library. I run my LoginScreen component using the render() method and ...
mehmettalhairmak's user avatar
0 votes
2 answers
911 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
2 votes
0 answers
292 views

I switched the react-native-maps provider to Google Maps on a React Native / Expo app. There's no issues when I run the app with Expo Go, but when opening the map on integration tests with react-...
Robert Pulkka'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
1 vote
1 answer
1k views

I've looked through many similar questions, but none seem to be facing the same issue I am having... ScreenLogin.test.tsx import React from 'react'; import { render, screen } from '@testing-library/...
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
37 votes
2 answers
80k views

I'm using ignite to create an expo react native app. I'm using this guide https://ignitecookbook.com/docs/recipes/GeneratorComponentTests to create component test files Here is the first test file ...
monty_lennie's user avatar
  • 3,451
1 vote
1 answer
587 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
0 votes
1 answer
834 views

I am using React Native Switch. I want to write a unit test (using jest and testing-library/react-native) for its value prop. But there is no value in its props My use case is there will be a default ...
manh.vu's user avatar
  • 636
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
1 vote
1 answer
2k views

I have implemented the component below, which is a card containing information about a product and a button that, when pressed, redirects the user to the details screen. export default function ...
LayTexas's user avatar
  • 645
0 votes
1 answer
390 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
1 vote
0 answers
403 views

I'm trying to test a failure on my API call with MSW, testing library and RTK Query. More on the context: I'm testing a hook and I'm calling a function and expect an API fail to assert that an error ...
Jérémie Bardon's user avatar
2 votes
1 answer
886 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
2k views

I have an expo react-native web component that renders fine on web but fails under test: import React, { useState, useEffect } from "react"; import { View } from "react-native"; ...
Ray's user avatar
  • 141
0 votes
1 answer
647 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
0 votes
1 answer
431 views

I wondering how can I test this kind of code with react native testing library? const Component = () => ( <View style={styles.iconWrapper}> {Platform.select({ ios: ( <...
Jorge Ossa'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
4 votes
1 answer
4k views

I’m a newbie with testing I’m trying to get a grip on testing React Native with Expo, Jest and React Native Testing Library I wrote a simple screen that takes data from an API and writes the first ...
Rafael's user avatar
  • 2,749
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
1 vote
0 answers
54 views

I have a hook called useStartGame which exports just 1 function like this: const useStartGame = () => { const startGame = (game) => { //Do something } return { startGame }; } Now I ...
Onyx's user avatar
  • 5,810
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
1 vote
0 answers
583 views

Suppose I have a component that calls a function, for example: // AComponent.js import { Text, View } from "react-native"; import { getAString } from "./utils/function"; const ...
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
0 votes
1 answer
194 views

I have an Expo App (the last expo which uses React 18) that I want to run some testing on But when trying to install React Native Testing Library, I get this error: I wonder if this error means that ...
Rafael's user avatar
  • 2,749
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
-1 votes
1 answer
839 views

I have a multi-step Sign Up form in my React Native application and I'm testing it with jest and RNTL. It works fine, but I just don't like how it looks. Now it's just one big test function which ...
rocketboy'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
1 vote
0 answers
155 views

I'm building a React Native app that lists live music gigs. The user can toggle between showing the current day's gigs or the current week's gigs. If the user presses the 'Gigs Today' button, the ...
Josh Simon's user avatar
2 votes
1 answer
408 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 vote
1 answer
2k views

I very new to writing tests. Basically I want to test if the menu opens up when clicking it. The options are buttons with the text "Edit" and "Delete". Test fails with "Unable ...
benwl's user avatar
  • 512
-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
1k views

SplashScreen is a React Native 0.70 component. generatePrivateKey.After rendering the component SplashScreen in jest 0.29, how to get the instance of method generatePrivateKey for further testing? The ...
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
3 votes
1 answer
1k views

I'm using @testing-library/react-native but when I try to test a component that has any rneui: 4.0.0-rc-6 components I get several errors: The first now was Details: /Users/ep/myProject/...
Eduardo Palacio's user avatar
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
0 votes
2 answers
962 views

I am trying to write the tests for the NavBar component (using react-native-testing-library) that has several buttons that are basically just icons (using ui-kitten for react native). So I can't get ...
dnd1993's user avatar
  • 161