-
Notifications
You must be signed in to change notification settings - Fork 664
Closed
Labels
Description
What problem does this feature solve?
Higher-order components make use of named slots. It's possible to test higher-order components via shallowMount because named slot content can be mocked, but it's not possible to test components which consume higher-order components because their generated named slot output is not available in the stubbed content.
#782 added support for outputting default slot content, but not named slots.
To be clear, an example of a component which needs this support is:
<!-- myComponent.vue -->
<template>
<HigherOrderComponent foo="bar">
default slot content
<template v-slot="header">header slot content</template>
<template v-slot="footer">footer slot content<HigherOrderComponent foo="waldo"/></template>
</HigherOrderComponent>
</template>
Currently, this is stubbed out to only:
<higherordercomponent-stub foo="bar">default slot content</higherordercomponent-stub>
The end user experience should be that components which generate named slot content "just work" when testing with shallowMount.
What does the proposed API look like?
The API would not change.
nogi-ogi and wasprobot