From: Shigma Date: Wed, 28 Sep 2022 02:36:11 +0000 (+0800) Subject: test(slots): ensure createSlots helper work with ssr slots (#6660) X-Git-Tag: v3.2.40~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3cc8e024e60c85860baf5de13996506c7e4de7fb;p=thirdparty%2Fvuejs%2Fcore.git test(slots): ensure createSlots helper work with ssr slots (#6660) --- diff --git a/packages/runtime-core/__tests__/helpers/createSlots.spec.ts b/packages/runtime-core/__tests__/helpers/createSlots.spec.ts index 891789d048..2af24380cc 100644 --- a/packages/runtime-core/__tests__/helpers/createSlots.spec.ts +++ b/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 },