Skip to content

Commit b31712e

Browse files
authored
test(teleport): fix meaningless test case (#2872)
1 parent 3756270 commit b31712e

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

packages/runtime-core/__tests__/components/Teleport.spec.ts

+3-7
Original file line numberDiff line numberDiff line change
@@ -106,24 +106,20 @@ describe('renderer: teleport', () => {
106106
const root = nodeOps.createElement('div')
107107
const children = ref([h('div', 'teleported')])
108108

109-
render(h(Teleport, { to: target }, children.value), root)
109+
render(h(() => h(Teleport, { to: target }, children.value)), root)
110110
expect(serializeInner(target)).toMatchInlineSnapshot(
111111
`"<div>teleported</div>"`
112112
)
113113

114114
children.value = []
115115
await nextTick()
116116

117-
expect(serializeInner(target)).toMatchInlineSnapshot(
118-
`"<div>teleported</div>"`
119-
)
117+
expect(serializeInner(target)).toMatchInlineSnapshot(`""`)
120118

121119
children.value = [createVNode(Text, null, 'teleported')]
122120
await nextTick()
123121

124-
expect(serializeInner(target)).toMatchInlineSnapshot(
125-
`"<div>teleported</div>"`
126-
)
122+
expect(serializeInner(target)).toMatchInlineSnapshot(`"teleported"`)
127123
})
128124

129125
test('should remove children when unmounted', () => {

0 commit comments

Comments
 (0)