Browse Source

test(ssr): add missing test for async component in slot

dev
Eduardo San Martin Morote 4 years ago
parent
commit
67901e78ef
  1. 28
      test/ssr/ssr-string.spec.js

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

@ -694,6 +694,34 @@ describe('SSR: renderToString', () => {
}) })
}) })
// #11963, #10391
it('renders async children passed in slots', done => {
const Parent = {
template: `<div><slot name="child"/></div>`
}
const Child = {
template: `<p>child</p>`
}
renderVmWithOptions({
template: `
<Parent>
<template #child>
<Child/>
</template>
</Parent>
`,
components: {
Parent,
Child: () => Promise.resolve(Child)
}
}, result => {
expect(result).toContain(
`<div data-server-rendered="true"><p>child</p></div>`
)
done()
})
})
it('everything together', done => { it('everything together', done => {
renderVmWithOptions({ renderVmWithOptions({
template: ` template: `

Loading…
Cancel
Save