test(srr): group portal tests

This commit is contained in:
Evan You
2020-03-10 15:23:14 -04:00
parent 97fb63d41f
commit 9c4de7b9ed
2 changed files with 18 additions and 23 deletions

View File

@@ -5,16 +5,11 @@ import {
withScopeId,
resolveComponent,
ComponentOptions,
Portal,
ref,
defineComponent
} from 'vue'
import { escapeHtml, mockWarn } from '@vue/shared'
import {
renderToString,
renderComponent,
SSRContext
} from '../src/renderToString'
import { renderToString, renderComponent } from '../src/renderToString'
import { ssrRenderSlot } from '../src/helpers/ssrRenderSlot'
mockWarn()
@@ -511,21 +506,6 @@ describe('ssr: renderToString', () => {
})
})
test('portal', async () => {
const ctx: SSRContext = {}
await renderToString(
h(
Portal,
{
target: `#target`
},
h('span', 'hello')
),
ctx
)
expect(ctx.portals!['#target']).toBe('<span>hello</span>')
})
describe('scopeId', () => {
// note: here we are only testing scopeId handling for vdom serialization.
// compiled srr render functions will include scopeId directly in strings.