-
Notifications
You must be signed in to change notification settings - Fork 665
Missing classes in vuetify element when shallowMount #883
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
Comments
Thanks for the bug report. I'll fix the issue with the class not rendering. The other issue, of the class not working as a selector, is intended behavior. You should select components using a component selector, name selector, or ref selector. Other selectors are not supported. |
In the .find() documentation, I can read: Use any valid selector. In the selector documentation, I can read:
So I believe CSS selectors should be supported selectors. => Anyway I believe that issue with class not rendering will fix it. |
Sorry that the docs are unclear, I'll rewrite them to improve clarity. The issue won't be fixed, if it was working previously it was a bug. CSS selectors are used to match rendered HTMLElements, stubbed components don't render HTMLElements, so a class selector won't work. |
Hi @eddyerburgh here to say the docs are still unclear on this in my opinion. Particularly the part about descendent combinators, makes it seems like you can use find or contains on component rendered html. Maybe a sentence to the effect of what you said above describing how stubbed components dont render HTMLElements so a class selector wont work there and to use the component name instead.
|
Uh oh!
There was an error while loading. Please reload this page.
Version
1.0.0-beta.22
Reproduction link
https://codesandbox.io/s/nn2p0w8300
Steps to reproduce
When
shallowMounting
a with a class="my-custom-class", I cannot find this element through wrapper.find(.my-custom-class) + this class is not present in snapshotWhat is expected?
What is actually happening?
Also I cannot do any find(".my-custom-class"). That is a regression compared to beta 20.
ps:
I don't care about tag="div" in this issue. Maybe it could be better to remove Vuetify prop (but it is a "could", not a "must" have in this bug)
The text was updated successfully, but these errors were encountered: