fix(runtime-dom): support mounting app to svg container (#2929)

fix #2926
This commit is contained in:
HcySunYang
2021-03-02 00:51:32 +08:00
committed by GitHub
parent 1a955e2278
commit 8ffcde2836
5 changed files with 44 additions and 9 deletions

View File

@@ -617,6 +617,20 @@ describe('SSR hydration', () => {
expect(spy).toHaveBeenCalled()
})
test('SVG as a mount container', () => {
const svgContainer = document.createElement('svg')
svgContainer.innerHTML = '<g></g>'
const app = createSSRApp({
render: () => h('g')
})
expect(
(app.mount(svgContainer).$.subTree as VNode<Node, Element> & {
el: Element
}).el instanceof SVGElement
)
})
describe('mismatch handling', () => {
test('text node', () => {
const { container } = mountWithHydration(`foo`, () => 'bar')