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

This commit is contained in:
Shigma 2022-09-28 10:36:11 +08:00 committed by GitHub
parent 8963c5508c
commit 3cc8e024e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View 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 },