Skip to content

Commit

Permalink
fix: render all children (#931)
Browse files Browse the repository at this point in the history
  • Loading branch information
eddyerburgh committed Aug 17, 2018
1 parent 236ab92 commit 71a2e7b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/shared/stub-components.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export function createBlankStub (
...this.$props
}
},
context ? context.children : this.$slots.default
context ? context.children : this.$options._renderChildren
)
}
}
Expand Down
19 changes: 19 additions & 0 deletions test/specs/shallow-mount.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,25 @@ describeRunIf(process.env.TEST_ENV !== 'node', 'shallowMount', () => {
expect(wrapper.html()).to.equal('<child-stub>Hello</child-stub>')
})

it('renders named slots', () => {
const localVue = createLocalVue()
localVue.component('child', {
template: '<div />'
})
const TestComponent = {
template: `
<child>
<p slot="header">Hello</p>
<p slot="footer">World</p>
</child>
`
}
const wrapper = shallowMount(TestComponent, {
localVue
})
expect(wrapper.html()).to.equal('<child-stub><p>Hello</p> <p>World</p></child-stub>')
})

it('renders no children if none supplied', () => {
const TestComponent = {
template: '<child />',
Expand Down

0 comments on commit 71a2e7b

Please sign in to comment.