From: daiwei Date: Tue, 19 Aug 2025 01:19:20 +0000 (+0800) Subject: test: add more tests X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5ba35e7bc2e8860269dc406566be6ebad008e970;p=thirdparty%2Fvuejs%2Fcore.git test: add more tests --- diff --git a/packages/runtime-vapor/__tests__/hydration.spec.ts b/packages/runtime-vapor/__tests__/hydration.spec.ts index 40db6dd7c2..d558c690e5 100644 --- a/packages/runtime-vapor/__tests__/hydration.spec.ts +++ b/packages/runtime-vapor/__tests__/hydration.spec.ts @@ -1791,23 +1791,45 @@ describe('Vapor Mode hydration', () => { describe('for', () => { test('basic v-for', async () => { + const { container, data } = await testHydration( + ``, + undefined, + ref(['a', 'b', 'c']), + ) + expect(formatHtml(container.innerHTML)).toMatchInlineSnapshot( + `"abc"`, + ) + + data.value.push('d') + await nextTick() + expect(formatHtml(container.innerHTML)).toMatchInlineSnapshot( + `"abcd"`, + ) + }) + + test('v-for with insertion parent + sibling component', async () => { const { container, data } = await testHydration( ``, - undefined, + { + Child: ``, + }, ref(['a', 'b', 'c']), ) expect(formatHtml(container.innerHTML)).toMatchInlineSnapshot( - `"
abc
"`, + `"
abc
3
"`, ) data.value.push('d') await nextTick() expect(formatHtml(container.innerHTML)).toMatchInlineSnapshot( - `"
abcd
"`, + `"
abcd
4
"`, ) })