Describe the bug A clear and concise description of what the bug is.
When having a teleport to body in a component you want to set attachTo of vue test utils to body, to do so you can set container: document.body in testing library.
This causes a problem that now render will remove the body node and causes document.body to be null after calling render.
To Reproduce Steps to reproduce the behavior:
Have a component that teleports to body and then set the container to the body.
Expected behavior
No issues.
Related information:
@testing-library/vue version: 8.1.0
Vue version: 3.5.25
node version: 24
npm (or yarn) version: 11
Additional context
This is caused by this line in the render.js:
unwrapNode(wrapper.parentElement);
This fixes it:
if (baseElement !== container) {
unwrapNode(wrapper.parentElement);
}
Describe the bug A clear and concise description of what the bug is.
When having a teleport to body in a component you want to set
attachToof vue test utils tobody, to do so you can setcontainer: document.bodyin testing library.This causes a problem that now
renderwill remove thebodynode and causesdocument.bodyto benullafter callingrender.To Reproduce Steps to reproduce the behavior:
Have a component that teleports to body and then set the container to the body.
Expected behavior
No issues.
Related information:
@testing-library/vueversion: 8.1.0Vueversion: 3.5.25nodeversion: 24npm(oryarn) version: 11Additional context
This is caused by this line in the
render.js:This fixes it: