mirror of https://github.com/vuejs/core.git
test: add tests for dynamic component in ssr vnode-based slot
This commit is contained in:
parent
d5b5108549
commit
1af4c304a9
|
@ -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', () => {
|
||||||
|
|
Loading…
Reference in New Issue