]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
chore: use fresh containers for app mount tests
authorEvan You <evan@vuejs.org>
Thu, 8 Aug 2024 06:42:07 +0000 (14:42 +0800)
committerEvan You <evan@vuejs.org>
Thu, 8 Aug 2024 06:42:16 +0000 (14:42 +0800)
packages/runtime-dom/__tests__/customElement.spec.ts

index eb7a4b368d7261c29b8afca514bdbc9e8b05cb82..38af0e2a63ef0e69d72759fc756c2aa7283e9a0e 100644 (file)
@@ -104,6 +104,8 @@ describe('defineCustomElement', () => {
         },
       })
       const app = createApp(containerComp)
+      const container = document.createElement('div')
+      document.body.appendChild(container)
       app.mount(container)
       const myInputEl = container.querySelector('my-el-input')!
       const inputEl = myInputEl.shadowRoot!.querySelector('input')!
@@ -115,7 +117,6 @@ describe('defineCustomElement', () => {
       myInputEl.removeAttribute('value')
       await nextTick()
       expect(inputEl.value).toBe('')
-      app.unmount()
     })
 
     test('should not unmount on move', async () => {
@@ -1188,6 +1189,8 @@ describe('defineCustomElement', () => {
         },
       }),
     )
+    const container = document.createElement('div')
+    document.body.appendChild(container)
     createApp({
       render() {
         return h('div', [