-
-
Notifications
You must be signed in to change notification settings - Fork 269
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
useVirtualizer not working in Vue Test Utils #709
Comments
For us, the last working version is |
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to 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: