From b31712ecc567456c6708f054eb4435e228ac33e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=B1=BC?= <31395977+leaon4@users.noreply.github.com> Date: Fri, 16 Jul 2021 04:36:36 +0800 Subject: [PATCH] test(teleport): fix meaningless test case (#2872) --- .../runtime-core/__tests__/components/Teleport.spec.ts | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/packages/runtime-core/__tests__/components/Teleport.spec.ts b/packages/runtime-core/__tests__/components/Teleport.spec.ts index 8b234e2b..e0a50b14 100644 --- a/packages/runtime-core/__tests__/components/Teleport.spec.ts +++ b/packages/runtime-core/__tests__/components/Teleport.spec.ts @@ -106,7 +106,7 @@ describe('renderer: teleport', () => { const root = nodeOps.createElement('div') 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( `"
teleported
"` ) @@ -114,16 +114,12 @@ describe('renderer: teleport', () => { children.value = [] await nextTick() - expect(serializeInner(target)).toMatchInlineSnapshot( - `"
teleported
"` - ) + expect(serializeInner(target)).toMatchInlineSnapshot(`""`) children.value = [createVNode(Text, null, 'teleported')] await nextTick() - expect(serializeInner(target)).toMatchInlineSnapshot( - `"
teleported
"` - ) + expect(serializeInner(target)).toMatchInlineSnapshot(`"teleported"`) }) test('should remove children when unmounted', () => {