Bug: wrapper.html()
produces wrong output for components with multiple root nodes
#1826
Labels
bug
Something isn't working
Describe the bug
When calling the
.html()
function on a wrapper containing multiple root nodes, the output of the individual nodes will be joined by a\n
character.This is problematic if the root nodes are inline elements. A
\n
between inline elements is rendered as whitespace, which means the nodes are separated by a space when rendered in the browser.This is inconsistent with the actual rendered output of the component.
To Reproduce
Workaround
wrapper.element.innerHTML
can be used.Related information:
@vue/test-utils
version: 2.1.0Vue
version: 3.2.38node
version: 18.11.0npm
version: 8.19.2The text was updated successfully, but these errors were encountered: