diff --git a/packages/shared/stub-components.js b/packages/shared/stub-components.js index b203971b3..71867a1d6 100644 --- a/packages/shared/stub-components.js +++ b/packages/shared/stub-components.js @@ -124,7 +124,7 @@ export function createBlankStub ( ...this.$props } }, - context ? context.children : this.$slots.default + context ? context.children : this.$options._renderChildren ) } } diff --git a/test/specs/shallow-mount.spec.js b/test/specs/shallow-mount.spec.js index 4f6ca15c9..139e431be 100644 --- a/test/specs/shallow-mount.spec.js +++ b/test/specs/shallow-mount.spec.js @@ -77,6 +77,25 @@ describeRunIf(process.env.TEST_ENV !== 'node', 'shallowMount', () => { expect(wrapper.html()).to.equal('Hello') }) + it('renders named slots', () => { + const localVue = createLocalVue() + localVue.component('child', { + template: '
' + }) + const TestComponent = { + template: ` + +

Hello

+

World

+
+ ` + } + const wrapper = shallowMount(TestComponent, { + localVue + }) + expect(wrapper.html()).to.equal('

Hello

World

') + }) + it('renders no children if none supplied', () => { const TestComponent = { template: '',