You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.
The text was updated successfully, but these errors were encountered:
Fedezable
changed the title
useVirtualizer not working wtth Vue Test Utils
useVirtualizer not working in Vue Test Utils
Apr 17, 2024
This is expected as in jsdom environment getBoundingClientRect will return height 0 for scroller element. There few options we can tackle this, one is to mock getBoundingClientRect using vi.fn have a look at #641 (comment)
Describe the bug
The virtualizer doesn't seem to work when used in Vue Test Utils.
Your minimal, reproducible example
Steps to reproduce
Create a new vite app with vue + ts template
npm create vite@latest
Install vitest and vue test utils
npm i vitest
npm i @vue/test-utils
Create a new component based on any vue tanstack virtual example, I tried with: -> RowVirtualizerFixed.vue in fixed example
Create a new basic test file RowVirtualizerFixed.test.ts and log the wrapper's html:
Looks like rowVirtualizer.value.getVirtualItems is not returning any row
The component looks fine when used in the app
Expected behavior
Some Rows should be printed in wrapper's html
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
Windows
tanstack-virtual version
3.0.4
TypeScript version
4.9.3
Additional context
No response
Terms & Code of Conduct
The text was updated successfully, but these errors were encountered: