vueuse / vueuse

Collection of essential Vue Composition Utilities for Vue 2 and 3

Home Page:https://vueuse.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

useVirtualList gets no update on test cases

eliamartani opened this issue · comments

Describe the bug

The issue is that the useVirtualList is not providing an updated list when running the application through unit tests. Making the application to behave as if there is no generated content (list) at all.

This issue is captured when the container is changed dynamically, in cases where the container is only visible in certain circumstances. The application starts the composable, the composable gets the reference of container but then the returned list is forever empty.

What happens is that the composable has useWatchForSizes and this function awaits for some change in container, that doesn't happen because it was changed dynamically and the only way to know is through size but size doesn't trigger the watch. Making list always empty.

Reproduction

don't have a link for that yet

System Info

System:
    OS: macOS 14.4.1
    CPU: (10) arm64 Apple M1 Pro
    Memory: 84.56 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.10.0 - ~/.nvm/versions/node/v20.10.0/bin/node
    npm: 10.2.3 - ~/.nvm/versions/node/v20.10.0/bin/npm
    pnpm: 8.14.1 - ~/.nvm/versions/node/v20.10.0/bin/pnpm
  Browsers:
    Brave Browser: 120.1.61.114
    Chrome: 124.0.6367.93
    Chrome Canary: 126.0.6452.0
    Edge: 124.0.2478.67
    Safari: 17.4.1

Used Package Manager

npm

Validations

#3855 contains the fix for the problem I detected