Description
Repository with reproduction: https://github.com/joaopslins/vue-sfc-styles-issue-repro
I'm using Vue 2 with Vue Testing Library
Using toBeVisible()
matcher against an element with display: none;
applied via a class in <styles>
section does not work in my test. Since I couldn't find other people with the same issue (except this SO question where the author solved the issue by other means), I guess this is some configuration issue, or I must be doing something wrong.
I wasn't sure in which repo I should open this issue but I think VTL is working properly, so it must be something related to vue-jest
. Unless I'm mistaken, I think vue-jest
should apply the styles correctly, due to https://github.com/vuejs/vue-jest#supported-style-languages.
This CodeSandbox makes me think it is possible though: https://codesandbox.io/s/vue-testing-sample-input-forked-drjsm?file=/src/components/Button.test.js
Relevant versions:
Node: 14
"jest": "^27.4.7",
"vue": "^2.6.11"
"@vue/vue2-jest": "^27.0.0-alpha.4",