]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
test: update edison/feat/v-skip 12767/head
authordaiwei <daiwei521@126.com>
Sat, 1 Feb 2025 01:53:26 +0000 (09:53 +0800)
committerdaiwei <daiwei521@126.com>
Sat, 1 Feb 2025 01:53:26 +0000 (09:53 +0800)
packages/runtime-core/__tests__/hydration.spec.ts

index 0a3e84b86c04b057f99d642aaa0a273a7a850d14..858d77ed503925884c1226587da2b78d8908225b 100644 (file)
@@ -2347,7 +2347,7 @@ describe('SSR hydration', () => {
         },
         template: `
           <button id="toggleBtn" @click="toggle=!toggle">toggle</button>
-          <div v-skip="toggle"><span>foo</span></div>
+          <div v-skip="toggle"><span>{{toggle}}</span></div>
         `,
       }
       const container = document.createElement('div')
@@ -2356,13 +2356,13 @@ describe('SSR hydration', () => {
       // hydrate
       createSSRApp(App).mount(container)
       expect(container.innerHTML).toBe(
-        '<!--[--><button id="toggleBtn">toggle</button><span>foo</span><!--]-->',
+        '<!--[--><button id="toggleBtn">toggle</button><span>true</span><!--]-->',
       )
 
       triggerEvent('click', container.querySelector('#toggleBtn')!)
       await nextTick()
       expect(container.innerHTML).toBe(
-        '<!--[--><button id="toggleBtn">toggle</button><div><span>foo</span></div><!--]-->',
+        '<!--[--><button id="toggleBtn">toggle</button><div><span>false</span></div><!--]-->',
       )
     })
 
@@ -2378,7 +2378,7 @@ describe('SSR hydration', () => {
         },
         template: `
           <button id="toggleBtn" @click="toggle=!toggle">toggle</button>
-          <Child v-skip="toggle"><span>foo</span></Child>
+          <Child v-skip="toggle"><span>{{toggle}}</span></Child>
         `,
       }
       const container = document.createElement('div')
@@ -2387,13 +2387,13 @@ describe('SSR hydration', () => {
       // hydrate
       createSSRApp(App).mount(container)
       expect(container.innerHTML).toBe(
-        '<!--[--><button id="toggleBtn">toggle</button><span>foo</span><!--]-->',
+        '<!--[--><button id="toggleBtn">toggle</button><span>true</span><!--]-->',
       )
 
       triggerEvent('click', container.querySelector('#toggleBtn')!)
       await nextTick()
       expect(container.innerHTML).toBe(
-        '<!--[--><button id="toggleBtn">toggle</button><div><span>foo</span></div><!--]-->',
+        '<!--[--><button id="toggleBtn">toggle</button><div><span>false</span></div><!--]-->',
       )
     })
 
@@ -2409,7 +2409,7 @@ describe('SSR hydration', () => {
         },
         template: `
           <button id="toggleBtn" @click="toggle=!toggle">toggle</button>
-          <Child v-skip="toggle"><span v-if="true">foo</span></Child>
+          <Child v-skip="toggle"><span v-if="true">{{toggle}}</span></Child>
         `,
       }
       const container = document.createElement('div')
@@ -2418,13 +2418,13 @@ describe('SSR hydration', () => {
       // hydrate
       createSSRApp(App).mount(container)
       expect(container.innerHTML).toBe(
-        '<!--[--><button id="toggleBtn">toggle</button><!--[--><span>foo</span><!--]--><!--]-->',
+        '<!--[--><button id="toggleBtn">toggle</button><!--[--><span>true</span><!--]--><!--]-->',
       )
 
       triggerEvent('click', container.querySelector('#toggleBtn')!)
       await nextTick()
       expect(container.innerHTML).toBe(
-        '<!--[--><button id="toggleBtn">toggle</button><div><span>foo</span></div><!--]-->',
+        '<!--[--><button id="toggleBtn">toggle</button><div><span>false</span></div><!--]-->',
       )
     })
 
@@ -2443,7 +2443,7 @@ describe('SSR hydration', () => {
           <button id="toggleBtn" @click="toggle=!toggle">toggle</button>
           <Child v-skip="toggle">
             <template #[slotName]>
-              <span>foo</span>
+              <span>{{toggle}}</span>
             </template>
           </Child>
         `,
@@ -2454,13 +2454,13 @@ describe('SSR hydration', () => {
       // hydrate
       createSSRApp(App).mount(container)
       expect(container.innerHTML).toBe(
-        '<!--[--><button id="toggleBtn">toggle</button><!--[--><span>foo</span><!--]--><!--]-->',
+        '<!--[--><button id="toggleBtn">toggle</button><!--[--><span>true</span><!--]--><!--]-->',
       )
 
       triggerEvent('click', container.querySelector('#toggleBtn')!)
       await nextTick()
       expect(container.innerHTML).toBe(
-        '<!--[--><button id="toggleBtn">toggle</button><div><span>foo</span></div><!--]-->',
+        '<!--[--><button id="toggleBtn">toggle</button><div><span>false</span></div><!--]-->',
       )
     })
 
@@ -2478,7 +2478,7 @@ describe('SSR hydration', () => {
           <button id="toggleBtn" @click="toggle=!toggle">toggle</button>
           <component :is="Child" v-skip="toggle">
             <template #[slotName]>
-              <span>foo</span>
+              <span>{{toggle}}</span>
             </template>
           </component>
         `,
@@ -2489,13 +2489,13 @@ describe('SSR hydration', () => {
       // hydrate
       createSSRApp(App).mount(container)
       expect(container.innerHTML).toBe(
-        '<!--[--><button id="toggleBtn">toggle</button><!--[--><span>foo</span><!--]--><!--]-->',
+        '<!--[--><button id="toggleBtn">toggle</button><!--[--><span>true</span><!--]--><!--]-->',
       )
 
       triggerEvent('click', container.querySelector('#toggleBtn')!)
       await nextTick()
       expect(container.innerHTML).toBe(
-        '<!--[--><button id="toggleBtn">toggle</button><div><span>foo</span></div><!--]-->',
+        '<!--[--><button id="toggleBtn">toggle</button><div><span>false</span></div><!--]-->',
       )
     })
   })