]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
test(slots): ensure createSlots helper work with ssr slots (#6660)
authorShigma <shigma10826@gmail.com>
Wed, 28 Sep 2022 02:36:11 +0000 (10:36 +0800)
committerGitHub <noreply@github.com>
Wed, 28 Sep 2022 02:36:11 +0000 (22:36 -0400)
packages/runtime-core/__tests__/helpers/createSlots.spec.ts

index 891789d048aa9907256de2333e2102f5fdc8103d..2af24380cca5ec8ba9a5d82b0000d25c661e669c 100644 (file)
@@ -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 },