diff --git a/packages/runtime-core/__tests__/hydration.spec.ts b/packages/runtime-core/__tests__/hydration.spec.ts index c3976a8f076..0c1f4a166d5 100644 --- a/packages/runtime-core/__tests__/hydration.spec.ts +++ b/packages/runtime-core/__tests__/hydration.spec.ts @@ -1050,4 +1050,31 @@ describe('SSR hydration', () => { expect(`Hydration children mismatch`).toHaveBeenWarned() }) }) + + // #6008 + describe('hydrate Static vnode', () => { + test('domType is ELEMENT should match', () => { + const html = ` A 0 B 1 C 2 D E` + const { vnode, container } = mountWithHydration(html, () => + createStaticVNode( + ` A 0 B 1 C 2 D E`, + 18 + ) + ) + expect(vnode.el).toBe(container.firstChild) + expect(`Hydration node mismatch`).not.toHaveBeenWarned() + }) + + test('domType is TEXT should match', () => { + const html = `A0 B 1 C 2 D E` + const { vnode, container } = mountWithHydration(html, () => + createStaticVNode( + `A0 B 1 C 2 D E`, + 18 + ) + ) + expect(vnode.el).toBe(container.firstChild) + expect(`Hydration node mismatch`).not.toHaveBeenWarned() + }) + }) })