test: add tests for dynamic component in ssr vnode-based slot

This commit is contained in:
daiwei 2025-08-13 15:53:02 +08:00
parent d5b5108549
commit 1af4c304a9
1 changed files with 36 additions and 1 deletions

View File

@ -1263,7 +1263,42 @@ describe('Vapor Mode hydration', () => {
) )
}) })
test.todo('with ssr slot vnode fallback', () => {}) test('in ssr slot vnode fallback', async () => {
const { container, data } = await testHydration(
`<template>
<components.Child>
<span>{{ data }}</span>
</components.Child>
</template>`,
{
Child: `
<template>
<component :is="'div'">
<slot />
</component>
</template>`,
},
ref('foo'),
)
expect(formatHtml(container.innerHTML)).toMatchInlineSnapshot(
`
"<div>
<!--[--><span>foo</span><!--]-->
<!--slot--></div><!--dynamic-component-->"
`,
)
data.value = 'bar'
await nextTick()
expect(formatHtml(container.innerHTML)).toMatchInlineSnapshot(
`
"<div>
<!--[--><span>bar</span><!--]-->
<!--slot--></div><!--dynamic-component-->"
`,
)
})
}) })
describe('if', () => { describe('if', () => {