mirror of https://github.com/vuejs/core.git
test: test case for #6966
This commit is contained in:
parent
67890daad1
commit
24964dab25
|
@ -72,6 +72,18 @@ describe('defineCustomElement', () => {
|
||||||
expect(e._instance).toBe(i)
|
expect(e._instance).toBe(i)
|
||||||
expect(e.shadowRoot!.innerHTML).toBe('<div>hello</div>')
|
expect(e.shadowRoot!.innerHTML).toBe('<div>hello</div>')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
test('remove then insert again', async () => {
|
||||||
|
container.innerHTML = `<my-element></my-element>`
|
||||||
|
const e = container.childNodes[0] as VueElement
|
||||||
|
container.removeChild(e)
|
||||||
|
await nextTick()
|
||||||
|
expect(e._instance).toBe(null)
|
||||||
|
expect(e.shadowRoot!.innerHTML).toBe('')
|
||||||
|
container.appendChild(e)
|
||||||
|
expect(e._instance).toBeTruthy()
|
||||||
|
expect(e.shadowRoot!.innerHTML).toBe('<div>hello</div>')
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('props', () => {
|
describe('props', () => {
|
||||||
|
|
Loading…
Reference in New Issue