Skip to content

Commit 8262edc

Browse files
committed
test for ssr rendering async components
1 parent 9cf6646 commit 8262edc

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

test/ssr/ssr-string.spec.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -877,6 +877,23 @@ describe('SSR: renderToString', () => {
877877
done()
878878
})
879879
})
880+
881+
it('render async components', done => {
882+
const Foo = () => Promise.resolve({
883+
render: h => h('div', [h('span', 'foo'), h(Bar)])
884+
})
885+
const Bar = () => ({
886+
component: Promise.resolve({
887+
render: h => h('span', 'bar')
888+
})
889+
})
890+
renderVmWithOptions({
891+
render: h => h(Foo)
892+
}, res => {
893+
expect(res).toContain(`<div data-server-rendered="true"><span>foo</span><span>bar</span></div>`)
894+
done()
895+
})
896+
})
880897
})
881898

882899
function renderVmWithOptions (options, cb) {

0 commit comments

Comments
 (0)