Skip to content

Commit 67901e7

Browse files
committedJun 2, 2021
test(ssr): add missing test for async component in slot
1 parent 1866033 commit 67901e7

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed
 

‎test/ssr/ssr-string.spec.js

+28
Original file line numberDiff line numberDiff line change
@@ -694,6 +694,34 @@ describe('SSR: renderToString', () => {
694694
})
695695
})
696696

697+
// #11963, #10391
698+
it('renders async children passed in slots', done => {
699+
const Parent = {
700+
template: `<div><slot name="child"/></div>`
701+
}
702+
const Child = {
703+
template: `<p>child</p>`
704+
}
705+
renderVmWithOptions({
706+
template: `
707+
<Parent>
708+
<template #child>
709+
<Child/>
710+
</template>
711+
</Parent>
712+
`,
713+
components: {
714+
Parent,
715+
Child: () => Promise.resolve(Child)
716+
}
717+
}, result => {
718+
expect(result).toContain(
719+
`<div data-server-rendered="true"><p>child</p></div>`
720+
)
721+
done()
722+
})
723+
})
724+
697725
it('everything together', done => {
698726
renderVmWithOptions({
699727
template: `

0 commit comments

Comments
 (0)
Please sign in to comment.