]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
test: update vShow tests to workaround jsdom regression
authorEvan You <yyx990803@gmail.com>
Mon, 8 Jan 2024 07:03:10 +0000 (15:03 +0800)
committerEvan You <yyx990803@gmail.com>
Mon, 8 Jan 2024 07:03:10 +0000 (15:03 +0800)
packages/runtime-dom/__tests__/directives/vShow.spec.ts

index e2e5baac45eae593624c1dd267489de81e3d01ae..5e837650854788e5d936f1f1452c8caa524dbdc5 100644 (file)
@@ -30,7 +30,7 @@ describe('runtime-dom: v-show directive', () => {
     })
     render(h(component), root)
 
-    const $div = root.querySelector('div')
+    const $div = root.children[0]
 
     expect($div.style.display).toEqual('')
   })
@@ -46,7 +46,7 @@ describe('runtime-dom: v-show directive', () => {
     })
     render(h(component), root)
 
-    const $div = root.querySelector('div')
+    const $div = root.children[0]
 
     expect($div.style.display).toEqual('none')
   })
@@ -62,7 +62,7 @@ describe('runtime-dom: v-show directive', () => {
     })
     render(h(component), root)
 
-    const $div = root.querySelector('div')
+    const $div = root.children[0]
     const data = root._vnode.component.data
 
     expect($div.style.display).toEqual('')
@@ -113,7 +113,7 @@ describe('runtime-dom: v-show directive', () => {
     })
     render(h(component), root)
 
-    const $div = root.querySelector('div')
+    const $div = root.children[0]
     const data = root._vnode.component.data
 
     expect($div.style.display).toEqual('block')
@@ -138,7 +138,7 @@ describe('runtime-dom: v-show directive', () => {
     })
     render(h(component), root)
 
-    const $div = root.querySelector('div')
+    const $div = root.children[0]
 
     expect($div.style.display).toEqual('none')
 
@@ -173,7 +173,7 @@ describe('runtime-dom: v-show directive', () => {
     })
     render(h(component), root)
 
-    const $div = root.querySelector('div')
+    const $div = root.children[0]
 
     expect($div.style.display).toEqual('none')