@@ -8,6 +8,7 @@ import {
|
||||
defineComponent,
|
||||
createTextVNode,
|
||||
createStaticVNode,
|
||||
KeepAlive,
|
||||
withCtx
|
||||
} from 'vue'
|
||||
import { escapeHtml } from '@vue/shared'
|
||||
@@ -604,6 +605,17 @@ function testRender(type: string, render: typeof renderToString) {
|
||||
})
|
||||
})
|
||||
|
||||
describe('vnode component', () => {
|
||||
test('KeepAlive', async () => {
|
||||
const MyComp = {
|
||||
render: () => h('p', 'hello')
|
||||
}
|
||||
expect(await render(h(KeepAlive, () => h(MyComp)))).toBe(
|
||||
`<!--[--><p>hello</p><!--]-->`
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
describe('raw vnode types', () => {
|
||||
test('Text', async () => {
|
||||
expect(await render(createTextVNode('hello <div>'))).toBe(
|
||||
|
||||
Reference in New Issue
Block a user