Open
Description
Describe the bug
Using vue3, vue-test-utils and vitest, checking for component visibility with isVisible does not work as it is always true.
To Reproduce
Component under test :
<template>
<span class="one" >LABEL NOT DISPLAYED</span>
<span class="two" >LABEL ALWAYS DISPLAYED</span>
</template>
<style lang="scss">
.one{
visibility: hidden;
}
</style>
Test File:
const wrapper = mount(Component, {
props:{...},
attachTo: document.body
})
expect(wrapper.text()).toEqual("LABEL ALWAYS DISPLAYED") // Return false as both span are rendered : "LABEL NOT DISPLAYEDLABEL ALWAYS DISPLAYED"
using wrapper.find(".one").isVisible()
return true as well
Expected behavior
wrapper.find(".one")
should not be found and Wrapper.text() should return only : LABEL ALWAYS DISPLAYED
Related information:
- "@vue/test-utils": "^2.4.6",
- "vitest": "^2.1.3",
- tested with "happy-dom" and "jsdom"
Activity