Skip to content

Commit

Permalink
test: test case for vuejs#6966
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 authored and chrislone committed Feb 4, 2023
1 parent e260124 commit eb217fc
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/runtime-dom/__tests__/customElement.spec.ts
Expand Up @@ -72,6 +72,18 @@ describe('defineCustomElement', () => {
expect(e._instance).toBe(i)
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', () => {
Expand Down

0 comments on commit eb217fc

Please sign in to comment.