You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using attachTo: document.body on the mount call and in my case I can't even use the workaround through .attributes(...) since I'm setting display: none through the style element.
Subject of the issue
@vue/test-utils: 2.3.2
jsdom: 22.0.0
vitest: 0.31.0
Using vue3, vue-test-utils and vitest with jsdom - our tests are failing on
isVisible().toBeFalsy()
The documentation says the
display: none
is one method used to identify isVisible()https://v1.test-utils.vuejs.org/api/wrapper/isvisible.html
The tests were passing using Jest
Steps to reproduce
Mount wrapper
Element when shown
<div class="accordionRow" style="">
Element when hidden
<div class="accordionRow" style="display: none;">
Using
Expected behaviour
Test should pass when the attribute style is
display: none;
and.isVisible().toBeFalsy()
is used for the assertionActual behaviour
Test fails because the assertion is not seeing
display: none;
Possible Solution
expect(wrapper.find('.accordionRow').attributes('style')).toBe('display: none;')
The text was updated successfully, but these errors were encountered: