From: daiwei Date: Sat, 26 Apr 2025 13:12:07 +0000 (+0800) Subject: wip: add more tests X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ca34d4aa29381052760c74d8fbfa4898b89fb13d;p=thirdparty%2Fvuejs%2Fcore.git wip: add more tests --- diff --git a/packages/runtime-vapor/__tests__/hydration.spec.ts b/packages/runtime-vapor/__tests__/hydration.spec.ts index d8c40bdc6b..016872b56a 100644 --- a/packages/runtime-vapor/__tests__/hydration.spec.ts +++ b/packages/runtime-vapor/__tests__/hydration.spec.ts @@ -98,7 +98,57 @@ describe('Vapor Mode hydration', () => { expect(container.innerHTML).toMatchInlineSnapshot(`"bar"`) }) - test.todo('consecutive text nodes', () => {}) + test('consecutive text nodes', async () => { + const { data, container } = await testHydration(` + + `) + expect(container.innerHTML).toMatchInlineSnapshot(`"foofoo"`) + + data.value = 'bar' + await nextTick() + expect(container.innerHTML).toMatchInlineSnapshot(`"barbar"`) + }) + + test('consecutive text nodes with anchor insertion', async () => { + const { data, container } = await testHydration(` + + `) + expect(container.innerHTML).toMatchInlineSnapshot( + `"foofoo"`, + ) + + data.value = 'bar' + await nextTick() + expect(container.innerHTML).toMatchInlineSnapshot( + `"barbar"`, + ) + }) + + test('mixed text nodes', async () => { + const { data, container } = await testHydration(` + + `) + expect(container.innerHTML).toMatchInlineSnapshot(`"fooAfooBfoo"`) + + data.value = 'bar' + await nextTick() + expect(container.innerHTML).toMatchInlineSnapshot(`"barAbarBbar"`) + }) + + test('mixed text nodes with anchor insertion', async () => { + const { data, container } = await testHydration(` + + `) + expect(container.innerHTML).toMatchInlineSnapshot( + `"fooAfooBfoo"`, + ) + + data.value = 'bar' + await nextTick() + expect(container.innerHTML).toMatchInlineSnapshot( + `"barAbarBbar"`, + ) + }) }) describe('element', () => {