Skip to content

Commit

Permalink
chore: update
Browse files Browse the repository at this point in the history
  • Loading branch information
sxzz committed Mar 24, 2024
1 parent 5b76208 commit 9510748
Showing 1 changed file with 27 additions and 29 deletions.
56 changes: 27 additions & 29 deletions packages/runtime-vapor/__tests__/componentSlots.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,44 +12,42 @@ import {
import { makeRender } from './_utils'

const define = makeRender<any>()
function renderWithSlots(slots: any): any {
let instance: any
const Comp = defineComponent({
render() {
const t0 = template('<div></div>')
const n0 = t0()
instance = getCurrentInstance()
return n0
},
})

describe('component: slots', () => {
function renderWithSlots(slots: any): any {
let instance: any
const Comp = defineComponent({
vapor: true,
render() {
const t0 = template('<div></div>')
const n0 = t0()
instance = getCurrentInstance()
return n0
},
})

const { render } = define({
render() {
return createComponent(Comp, {}, slots)
},
})
const { render } = define({
render() {
return createComponent(Comp, {}, slots)
},
})

render()
return instance
}
render()
return instance
}

describe('component: slots', () => {
test('initSlots: instance.slots should be set correctly', () => {
const { slots } = renderWithSlots({ _: 1 })
expect(slots).toMatchObject({ _: 1 })
})

// NOTE: slot normalization is not supported
// test.todo(
// 'initSlots: should normalize object slots (when value is null, string, array)',
// () => {},
// )
// test.todo(
// 'initSlots: should normalize object slots (when value is function)',
// () => {},
// )
test.todo(
'initSlots: should normalize object slots (when value is null, string, array)',
() => {},
)
test.todo(
'initSlots: should normalize object slots (when value is function)',
() => {},
)

test('initSlots: instance.slots should be set correctly', () => {
let instance: any
Expand Down

0 comments on commit 9510748

Please sign in to comment.