Closed ElVisPL closed 9 months ago
This is strange indeed. Would you be able to look into it and open a PR?
Instead of using the tag name wrapper.findComponent('welcome-item-stub')
you can use the component name wrapper.findComponent({ name: 'WelcomeItem' })
which correctly returns the props of the component.
I guess the selector does not correctly resolve the component. Therefore the props are not treated correctly and instead returned by .attributes()
. I will try to investigate the code, when I got some time
Describe the bug This is known issue in vue test utils v1, but the previous workaround doesn't work anymore
vs
To Reproduce
https://stackblitz.com/edit/github-orekbd?file=src%2Fcomponents%2F__tests__%2FTheWelcome.spec.ts
run
yarn test:utils TheWelcome
Expected behavior
findComponent.props()
returns props of child componentRelated information:
In vue test utils v1 there was workaround:
Now there is no
wrapper.vm.$children