Преглед изворни кода

test(slots): ensure createSlots helper work with ssr slots (#6660)

Shigma пре 3 година
родитељ
комит
3cc8e024e6
1 измењених фајлова са 8 додато и 0 уклоњено
  1. 8 0
      packages/runtime-core/__tests__/helpers/createSlots.spec.ts

+ 8 - 0
packages/runtime-core/__tests__/helpers/createSlots.spec.ts

@@ -26,6 +26,14 @@ describe('createSlot', () => {
     expect(ret.key).toBe('1')
   })
 
+  it('should check nullability', () => {
+    const slot = (() => {}) as Slot
+    const dynamicSlot = [{ name: 'descriptor', fn: slot, key: '1' }]
+
+    const actual = createSlots(record, dynamicSlot)
+    expect(actual).toHaveProperty('descriptor')
+  })
+
   it('should add all slots to the record', () => {
     const dynamicSlot = [
       { name: 'descriptor', fn: slot },