Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not calling loadMore with @testing-library/react #269

Open
ButuzGOL opened this issue Jan 8, 2021 · 2 comments
Open

Not calling loadMore with @testing-library/react #269

ButuzGOL opened this issue Jan 8, 2021 · 2 comments

Comments

@ButuzGOL
Copy link

ButuzGOL commented Jan 8, 2021

In browser all works fine

<div
        style={{
          marginLeft: -24,
          marginRight: -24,
          overflow: 'auto',
          height: 'calc(100% - 122px)',
        }}
        ref={scrollParentRef}
      >
        <InfiniteScroll
          pageStart={0}
          loadMore={fetchData}
          hasMore={hasMoreData.current}
          useWindow={false}
          getScrollParent={() => scrollParentRef.current}
          loader={
            <Card>
              <Skeleton active />
            </Card>
          }
        >
          {data.map((item) => (
            <Comment
              key={item.id}
              content={<p>{item.comment}</p>}
            />
          ))}
        </InfiniteScroll>

But when start testing it not calls fetchData (loadMore) fn

@engp8691
Copy link

I have the same issue. Can someone help me on this question also? Thank you so much.

@ButuzGOL
Copy link
Author

i moved to this lib
https://github.com/ankeetmaini/react-infinite-scroll-component
works fine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants