Open
Description
Subject of the issue
Example:
Lets say I have the following parent component:
// ParentComponent
<template>
<child-component :prop-a="propA" :prop-b="propB" />
</template>
When unit testing my ParentComponent I want to check the correct usage of the underlying ChildComponent as well and test its properties. Back in Vue2 I normally did:
const wrapper = shallowMount(ParentComponent);
const child = wrapper.vm.$children[0];
expect(child.$props.....).toBe(...);
expect(child.$props.....).toBe(....);
expect(child.$props.....).toBe(....);
I used the wrapper.vm.$children[0]
approach, because wrapper.find(ChildComponent)
would return the same wrapper again. (because it is the root)
Now my question is: How can I select the child-component in Vue3 to tests its properties?
Steps to reproduce
Tell us how to reproduce this issue. Please provide a working and simplified example.
Expected behaviour
What should happen?
Actual behaviour
What happens instead?
Possible Solution
What are the alternative solutions? Please describe what else you have considered?
Metadata
Metadata
Assignees
Labels
No labels