Skip to content

Commit 05455b1

Browse files
author
Cory Cunningham
authored
docs update for fireEvent.onScroll() (#633)
1 parent f94dc51 commit 05455b1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

website/docs/API.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,10 @@ fireEvent.scroll(getByTestId('flat-list'), eventData);
333333
expect(onEndReached).toHaveBeenCalled();
334334
```
335335

336+
:::note
337+
If you're noticing that components are not being found on a list, even after mocking a scroll event, try changing the [`initialNumToRender`](https://reactnative.dev/docs/flatlist#initialnumtorender) that you have set. If you aren't comfortable changing the code to accept this prop from the unit test, try using an e2e test that might better suit what use case you're attempting to replicate.
338+
:::
339+
336340
## `waitFor`
337341

338342
- [`Example code`](https://github.com/callstack/react-native-testing-library/blob/master/src/__tests__/waitFor.test.js)

0 commit comments

Comments
 (0)