Skip to content

Commit

Permalink
test: test case for #6966
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Nov 11, 2022
1 parent 67890da commit 24964da
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/runtime-dom/__tests__/customElement.spec.ts
Original file line number Diff line number Diff line change
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 24964da

Please sign in to comment.