Skip to content

Commit

Permalink
test(slots): ensure createSlots helper work with ssr slots (vuejs#6660)
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma authored and chrislone committed Feb 4, 2023
1 parent 596ce50 commit b5fabfb
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/runtime-core/__tests__/helpers/createSlots.spec.ts
Expand Up @@ -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 },
Expand Down

0 comments on commit b5fabfb

Please sign in to comment.