Skip to content

wrapper.find(ComponentName) fails if run after a test for that specific component #956

Closed
@mkopinsky

Description

@mkopinsky

Version

1.0.0-beta.24

Reproduction link

https://github.com/mkopinsky/vue-test-loading-order-issue

Steps to reproduce

git clone git@github.com:mkopinsky/vue-test-loading-order-issue.git
npm install
npm run test:passes # This runs Parent.test.js first, and passes
npm run test:fails # This runs Child.test.js first, and fails

What is expected?

Test outcomes should not depend on the order the tests run

What is actually happening?

If the test for the parent component is run before the test for the child component, everything is dandy.
If a test for the child component is run first, the test for the parent component fails with Error: [vue-test-utils]: find did not return Component, cannot call find() on empty Wrapper when I call wrapper.find(ChildComponent)

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