-
Notifications
You must be signed in to change notification settings - Fork 269
Description
Describe the bug
In #219 it was raised that with the Vue 3 upgrade, Vue Test Utils will no longer mount directly to the target provided by the attachTo
option, but to a child div
element appended to the target. However, the unmount
function was never updated to account for this. Both when manually calling unmount
, and when using enableAutoUnmount
, Vue Test Utils leaves behind the div
element it created to mount the component.
This makes it infeasible to use attachTo
on the same target in multiple tests, as you end up with a large list of div
elements appended to the target from previous tests. Ideally unmount
should drop the wrapper element that mount
creates so that the mount target is left in a clean state.
Reproduction
Expected behavior
unmount
should not leave an extra div
on the element it was attached to.
Environment
System:
OS: macOS 15.5
CPU: (8) arm64 Apple M1 Pro
Memory: 218.30 MB / 32.00 GB
Shell: 5.9 - /bin/zsh
npmPackages:
@vue/test-utils: 2.4.6 => 2.4.6
vitest: 3.2.4 => 3.2.4
vue: 3.5.17 => 3.5.17
Additional context
No response