You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You will see the inconsistency of stub behavior between options object component and constructor component.
What is expected?
Both shallowMounted component renders the same html.
What is actually happening?
The child of stubbed component (GrandChild) is stubbed if Child is passed as options object while not stubbed if Child is constructor.
I'm not sure which behavior is intended but I think the behavior with options object stub is more useful. Because sometimes I want to control which child components should be stubs or not by passing the component itself to stubs option. And in that case, I will not expect the child component be rendered entirely (grandchildren components should be replaced with stubs).
The text was updated successfully, but these errors were encountered:
Version
1.0.0-beta.29
Reproduction link
https://github.com/ktsn/vue-test-utils-shallow-stub-issue
Steps to reproduce
yarn install
yarn test
What is expected?
Both
shallowMount
ed component renders the same html.What is actually happening?
The child of stubbed component (GrandChild) is stubbed if Child is passed as options object while not stubbed if Child is constructor.
I'm not sure which behavior is intended but I think the behavior with options object stub is more useful. Because sometimes I want to control which child components should be stubs or not by passing the component itself to
stubs
option. And in that case, I will not expect the child component be rendered entirely (grandchildren components should be replaced with stubs).The text was updated successfully, but these errors were encountered: