Skip to content

Commit

Permalink
test(ssr): test render function Transition usage in SSR
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Mar 22, 2021
1 parent e8e9b00 commit b2e00f0
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion packages/server-renderer/__tests__/render.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import {
createTextVNode,
createStaticVNode,
KeepAlive,
withCtx
withCtx,
Transition
} from 'vue'
import { escapeHtml } from '@vue/shared'
import { renderToString } from '../src/renderToString'
Expand Down Expand Up @@ -614,6 +615,15 @@ function testRender(type: string, render: typeof renderToString) {
`<!--[--><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', () => {
Expand Down

0 comments on commit b2e00f0

Please sign in to comment.