From: daiwei Date: Thu, 24 Apr 2025 01:26:33 +0000 (+0800) Subject: wip: add tests + skip fragment end anchor X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b5762b57aeaac32c3d25730391617fe2e8cbf75b;p=thirdparty%2Fvuejs%2Fcore.git wip: add tests + skip fragment end anchor --- diff --git a/packages/runtime-vapor/__tests__/hydration.spec.ts b/packages/runtime-vapor/__tests__/hydration.spec.ts index 67f5c634bb..ecb8d8202a 100644 --- a/packages/runtime-vapor/__tests__/hydration.spec.ts +++ b/packages/runtime-vapor/__tests__/hydration.spec.ts @@ -264,6 +264,48 @@ describe('Vapor Mode hydration', () => { ) }) + test('nested components with anchor insertion', async () => { + const { container, data } = await testHydration( + ` + + `, + { + Parent: ``, + Child: ``, + }, + ) + expect(container.innerHTML).toMatchInlineSnapshot( + `"
foo
"`, + ) + + data.value = 'bar' + await nextTick() + expect(container.innerHTML).toMatchInlineSnapshot( + `"
bar
"`, + ) + }) + + test('nested components with multi level anchor insertion', async () => { + const { container, data } = await testHydration( + ` + + `, + { + Parent: ``, + Child: ``, + }, + ) + expect(container.innerHTML).toMatchInlineSnapshot( + `"
foo
"`, + ) + + data.value = 'bar' + await nextTick() + expect(container.innerHTML).toMatchInlineSnapshot( + `"
bar
"`, + ) + }) + test('consecutive components with anchor insertion', async () => { const { container, data } = await testHydration( `