test(ssr): test render function Transition usage in SSR

This commit is contained in:
Evan You 2021-03-22 16:51:51 -04:00
parent e8e9b00f81
commit b2e00f011a

View File

@ -9,7 +9,8 @@ import {
createTextVNode, createTextVNode,
createStaticVNode, createStaticVNode,
KeepAlive, KeepAlive,
withCtx withCtx,
Transition
} from 'vue' } from 'vue'
import { escapeHtml } from '@vue/shared' import { escapeHtml } from '@vue/shared'
import { renderToString } from '../src/renderToString' import { renderToString } from '../src/renderToString'
@ -614,6 +615,15 @@ function testRender(type: string, render: typeof renderToString) {
`<!--[--><p>hello</p><!--]-->` `<!--[--><p>hello</p><!--]-->`
) )
}) })
test('Transition', async () => {
const MyComp = {
render: () => h('p', 'hello')
}
expect(await render(h(Transition, () => h(MyComp)))).toBe(
`<p>hello</p>`
)
})
}) })
describe('raw vnode types', () => { describe('raw vnode types', () => {