Skip to content

Commit 3cc8e02

Browse files
authored
test(slots): ensure createSlots helper work with ssr slots (#6660)
1 parent 8963c55 commit 3cc8e02

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

packages/runtime-core/__tests__/helpers/createSlots.spec.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,14 @@ describe('createSlot', () => {
2626
expect(ret.key).toBe('1')
2727
})
2828

29+
it('should check nullability', () => {
30+
const slot = (() => {}) as Slot
31+
const dynamicSlot = [{ name: 'descriptor', fn: slot, key: '1' }]
32+
33+
const actual = createSlots(record, dynamicSlot)
34+
expect(actual).toHaveProperty('descriptor')
35+
})
36+
2937
it('should add all slots to the record', () => {
3038
const dynamicSlot = [
3139
{ name: 'descriptor', fn: slot },

0 commit comments

Comments
 (0)