]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
wip(vapor): test cases
authorEvan You <evan@vuejs.org>
Wed, 12 Mar 2025 01:18:57 +0000 (09:18 +0800)
committerEvan You <evan@vuejs.org>
Wed, 12 Mar 2025 01:18:57 +0000 (09:18 +0800)
packages/runtime-vapor/__tests__/hydration.spec.ts

index d89d5fab374a851b8ae5256d3005f542fe520fb4..6ba2bf895fbb23ed7cfc6ba3da2d36d706330f18 100644 (file)
@@ -243,21 +243,45 @@ describe('Vapor Mode hydration', () => {
   test.todo('component with anchor insertion', async () => {
     const { container, data } = await testHydration(
       `
-      <template><div><span/><components.Child/><span/></div></template>
+      <template>
+        <div>
+          <span/>
+          <components.Child/>
+          <span/>
+        </div>
+      </template>
       `,
       {
         Child: `<template>{{ data }}</template>`,
       },
     )
-    expect(container.innerHTML).toMatchInlineSnapshot(
-      `"<div><span></span>foo<span></span></div>"`,
-    )
+    expect(container.innerHTML).toMatchInlineSnapshot()
 
     data.value = 'bar'
     await nextTick()
-    expect(container.innerHTML).toMatchInlineSnapshot(
-      `"<div><span></span>foo<span></span></div>"`,
+    expect(container.innerHTML).toMatchInlineSnapshot()
+  })
+
+  test.todo('consecutive component with anchor insertion', async () => {
+    const { container, data } = await testHydration(
+      `<template>
+        <div>
+          <span/>
+          <components.Child/>
+          <components.Child/>
+          <span/>
+        </div>
+      </template>
+      `,
+      {
+        Child: `<template>{{ data }}</template>`,
+      },
     )
+    expect(container.innerHTML).toMatchInlineSnapshot()
+
+    data.value = 'bar'
+    await nextTick()
+    expect(container.innerHTML).toMatchInlineSnapshot()
   })
 
   test.todo('if')