test(teleport): fix meaningless test case (#2872)
This commit is contained in:
parent
3756270272
commit
b31712ecc5
@ -106,7 +106,7 @@ describe('renderer: teleport', () => {
|
|||||||
const root = nodeOps.createElement('div')
|
const root = nodeOps.createElement('div')
|
||||||
const children = ref([h('div', 'teleported')])
|
const children = ref([h('div', 'teleported')])
|
||||||
|
|
||||||
render(h(Teleport, { to: target }, children.value), root)
|
render(h(() => h(Teleport, { to: target }, children.value)), root)
|
||||||
expect(serializeInner(target)).toMatchInlineSnapshot(
|
expect(serializeInner(target)).toMatchInlineSnapshot(
|
||||||
`"<div>teleported</div>"`
|
`"<div>teleported</div>"`
|
||||||
)
|
)
|
||||||
@ -114,16 +114,12 @@ describe('renderer: teleport', () => {
|
|||||||
children.value = []
|
children.value = []
|
||||||
await nextTick()
|
await nextTick()
|
||||||
|
|
||||||
expect(serializeInner(target)).toMatchInlineSnapshot(
|
expect(serializeInner(target)).toMatchInlineSnapshot(`""`)
|
||||||
`"<div>teleported</div>"`
|
|
||||||
)
|
|
||||||
|
|
||||||
children.value = [createVNode(Text, null, 'teleported')]
|
children.value = [createVNode(Text, null, 'teleported')]
|
||||||
await nextTick()
|
await nextTick()
|
||||||
|
|
||||||
expect(serializeInner(target)).toMatchInlineSnapshot(
|
expect(serializeInner(target)).toMatchInlineSnapshot(`"teleported"`)
|
||||||
`"<div>teleported</div>"`
|
|
||||||
)
|
|
||||||
})
|
})
|
||||||
|
|
||||||
test('should remove children when unmounted', () => {
|
test('should remove children when unmounted', () => {
|
||||||
|
Loading…
Reference in New Issue
Block a user