Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vue 2.7 : test of attribute on a stubbed component - does not work if value is boolean false #2059

Open
johndegey opened this issue Mar 6, 2023 · 1 comment

Comments

@johndegey
Copy link

Hello,

I'm using Vue 2.7.14, @testing-library with vue-test-utils 1.3.4
When I try to test an attribute on a stubbed component, if the value is boolean 'false', the attribute is not render in the html, so it can't be tested.

Subject of the issue

test of an attribute for a stubbed component.

Steps to reproduce

https://github.com/johndegey/vite-vitest-vue2
Run test in branch 'stubbing-with-attribute'

Expected behaviour

Test should work when the attribute is a boolean 'false' value.
Expect to see the attribute in the output of the stubbed component.

Actual behaviour

Test fails, the attribute is not present in the output of the stubbed component.

Possible Solution

Alternative : using Number and validate it should only be 0 | 1

Best
John

@lmiller1990
Copy link
Member

Hi!

Sounds like dup of #2048?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants