How do you test onviewableitemschanged in SectionList?

Viewed 94

I have a component that tracks which section of a section list is visible and updates the "active" state based on the visibility of the section.

What I am trying to do is increase the code coverage of Jest to when the visibility does change.

I already have a

useEffect( ()=> { sectionListRef.current?.recordInteraction() } )

To force the onViewableItemsChanged to be called for the initial visible list. However, I don't see the lines being covered by jest --coverage

0 Answers
Related