Skip to content

Commit 14b266f

Browse files
committed
Fail to repro with SFC
1 parent b5ffdda commit 14b266f

File tree

3 files changed

+42
-0
lines changed

3 files changed

+42
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<template>
2+
<ComponentWithVSlot>
3+
<template v-slot:newSyntax>
4+
<p class="new-example">new slot syntax</p>
5+
</template>
6+
</ComponentWithVSlot>
7+
</template>
8+
9+
<script>
10+
import ComponentWithVSlot from './component-with-v-slot.vue'
11+
12+
export default {
13+
name: 'ComponentWithVSlotSyntax',
14+
15+
components: { ComponentWithVSlot }
16+
}
17+
</script>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<template>
2+
<div>
3+
<slot name="newSyntax" />
4+
</div>
5+
</template>
6+
7+
<script>
8+
export default {
9+
name: 'ComponentWithVSlot'
10+
}
11+
</script>

test/specs/shallow-mount.spec.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import ComponentWithNestedChildren from '~resources/components/component-with-ne
77
import ComponentWithLifecycleHooks from '~resources/components/component-with-lifecycle-hooks.vue'
88
import ComponentWithoutName from '~resources/components/component-without-name.vue'
99
import ComponentAsAClassWithChild from '~resources/components/component-as-a-class-with-child.vue'
10+
import ComponentWithVSlotSyntax from '~resources/components/component-with-v-slot-syntax.vue'
11+
import ComponentWithVSlot from '~resources/components/component-with-v-slot.vue'
1012
import RecursiveComponent from '~resources/components/recursive-component.vue'
1113
import { vueVersion } from '~resources/utils'
1214
import { describeRunIf, itDoNotRunIf } from 'conditional-specs'
@@ -96,6 +98,18 @@ describeRunIf(process.env.TEST_ENV !== 'node', 'shallowMount', () => {
9698
)
9799
})
98100

101+
it('renders SFC with named slots with v-slot syntax', () => {
102+
const wrapper = shallowMount(ComponentWithVSlotSyntax)
103+
104+
expect(wrapper.find(ComponentWithVSlot).exists()).to.equal(true)
105+
expect(wrapper.find('.new-example').exists()).to.equal(true)
106+
expect(wrapper.html()).to.equal(
107+
'<componentwithvslot-stub>\n' +
108+
' <p class="new-example">new slot syntax</p>\n' +
109+
'</componentwithvslot-stub>'
110+
)
111+
})
112+
99113
it('renders named slots with v-slot syntax', () => {
100114
const localVue = createLocalVue()
101115
localVue.component('Foo', {

0 commit comments

Comments
 (0)