-
Hello everyone, we are using tanstack table and the tanstack virtualizer with my team inside react in our vitest project for a while now and we had some tests that were working flawlessly on version With the release of the Here is a small example of a failing test I wrote as I can't show you our actual code: VirtualList.tsx:
test.spec.tsx:
You'll see that vitest will fail on the line I'm not sure if it's a bug or there is something we forgot to have a good testing environment for the virtualizer ? Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi, the issue is that we changed how the virtualizer behaves when scrolling element has no size, as in test jsdom will return 0 that's why no items are returned. Checkout the PR #598 for more details and reason behind this change. @Ex4l for unit test you can mock the getBoundingClientRect for the scroller element. |
Beta Was this translation helpful? Give feedback.
Hi, the issue is that we changed how the virtualizer behaves when scrolling element has no size, as in test jsdom will return 0 that's why no items are returned. Checkout the PR #598 for more details and reason behind this change.
@Ex4l for unit test you can mock the getBoundingClientRect for the scroller element.