-
Notifications
You must be signed in to change notification settings - Fork 668
Custom elements should not be stubbed #1047
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
I'll revert it to the original behavior where elements that can't be resolved are not stubbed |
@eddyerburgh I have a question regarding this fix. Right now we end up having deep rendered child components (because they are not stubbed) even if we use shallowMount So it would be nice to have a property in the config which allow us to choose what we want as a default behaviour for child components / stubs rendering test mounting code: Component HTML output using vue test utils 25 output using vue test utils 26
|
@Mboulianne you could pass explicit stubs with the shallowMount(TestComponent, {
stubs: {
ComponentToBeStubbed: { template: '<div /> }
}
}) |
Well it's confusing considering the fact that I use shallowMount, is it not? |
It does for Components, not for custom elements. That's intended. If you experience something different, please submit a real bug report in a fresh issue. And look up how to properly highlight code here: https://guides.github.com/features/mastering-markdown/#GitHub-flavored-markdown |
Version
1.0.0-beta.26
Reproduction link
https://codesandbox.io/s/8ynwwjm880?module=%2Ftest%2Fshallow-mount.spec.js&previewwindow=tests
Steps to reproduce
Go to the reproduction link, bump @vue/test-utils version to 1.0.0-beta.26, see the test failing
What is expected?
Default Vue behaviour with custom element
What is actually happening?
The custom element is stubbed thus not rendered properly and loose attached DOM listeners
The text was updated successfully, but these errors were encountered: