-
Notifications
You must be signed in to change notification settings - Fork 113
Open
Labels
bugSomething isn't workingSomething isn't working
Description
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/vueversion: 8.1.0Vueversion: 3.5.25nodeversion: 24npm(oryarn) 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);
}Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working