Is it possible to test RecyclerListView elements? #788
Unanswered
kalpeshsingh
asked this question in
Q&A
Replies: 1 comment 3 replies
-
Hello @thymikee onPress, onScroll etc. can be covered. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
👋 Hello community/contributors/maintainers,
As the philosophy of Testing Library is to mimic user interaction, I wanted to incorporate that philosophy in my code.
Problem statement
The RecyclerListView helps to render listview for React Native in performant manner. I use this to render card layouts (like YouTube) in my app.
I want to trigger certain user events such as press, scroll etc. but I'm unable to do it because Testing library is unable to render those elements (
LargeCarouselCard
). I checked it usingdebug
function.If I the library can't find elements then I can't use
fireEvents
. Thus I can't test the common scenario for this case.Expectation
The Testing Library should render those card elements to perform user events on them to test the code.
Output
Minimum repo
Check App.test.js
Codesandbox
Beta Was this translation helpful? Give feedback.
All reactions