Skip to content

beta26: Component registration warning which occurs only in the context of vue-test-utils #1054

Closed
@mkopinsky

Description

@mkopinsky

Version

1.0.0-beta.26

Reproduction link

https://github.com/mkopinsky/vue-test-utils-component-registration

Steps to reproduce

git clone git@github.com:mkopinsky/vue-test-utils-component-registration.git
cd vue-test-utils-component-registration
yarn install
yarn run test:unit

What is expected?

Tests should pass without any warnings

What is actually happening?

As of beta26, I get this warning:

[Vue warn]: Unknown custom element: <modal> - did you register the component correctly? For recursive components, make sure to provide the "name" option.

found in

---> <HelloWorld> at src/components/HelloWorld.vue

Weirdly enough, if I comment out the <survey/> component from the HelloWorld.vue template, vue-test-utils stops complaining about the <modal/> component. So somehow when vue-test-utils loads the <survey/> component, that causes it to fail to load the modal component.

It's possible this is an issue with how vue2-strap3 or survey-vue is exporting their components. But this app works fine in the browser, and that means it probably should work in vue-test-utils as well.


In beta25, vue-test-utils output the following warning, which no longer appears in beta26. I don't know if that's related to this, but I thought it was worthy of inclusion. Setting that config in beta26 does not affect the component registration warning.

[vue-test-utils]: The child component <survey> has been modified to ensure it is created with properties injected by Vue Test Utils. 
This is because the component was created with Vue.extend, or uses the Vue Class Component decorator. 
Because the component has been modified, it is not possible to find it with a component selector. To find the component, you must stub it manually using the stubs mounting option, or use a name or ref selector. 
You can hide this warning by setting the Vue Test Utils config.logModifiedComponents option to false.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions