I am new to React Native Testing Library. For my React native app I am using styled components and Typescript. I fetched the data and pass to my flatList. In Flat-list's render item I have created one global component where it display all the data which is wrap with one touchable container . When user will click the that touchable opacity it will go to single product details. screen. I want to test the touchable opacity component.
For testing the component I have created one mock container. And I wrap my touchable opacity component. I followed this article to create mocked navigator. But when I tried to test this suite I got this error: Got an invalid value for 'component' prop for the screen 'MockedScreen'. It must be a valid React Component. I don't know what I am making mistake.
I am new to React Native Testing Library. For my React native app I am using styled components and Typescript. I fetched the data and pass to my flatList. In Flat-list's render item I have created one global component where it display all the data which is wrap with one touchable container . When user will click the that touchable opacity it will go to single product details. screen. I want to test the touchable opacity component.
For testing the component I have created one mock container. And I wrap my touchable opacity component. I followed this article to create mocked navigator. But when I tried to test this suite I got this error:
Got an invalid value for 'component' prop for the screen 'MockedScreen'. It must be a valid React Component.
I don't know what I am making mistake.This is my mocked container
This is my mocked screen
This is my test suite where I am getting failed test