浏览代码

Fix failing test

Ryan Chandler 5 年之前
父节点
当前提交
73a8fe4040
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      test/on.spec.js

+ 2 - 2
test/on.spec.js

@@ -66,7 +66,7 @@ test('.stop modifier', async () => {
 test('.self modifier', async () => {
     document.body.innerHTML = `
         <div x-data="{ foo: 'bar' }">
-            <div x-on:click.self="foo = 'baz'">
+            <div x-on:click.self="foo = 'baz'" id="selfTarget">
                 <button></button>
             </div>
             <span x-text="foo"></span>
@@ -83,7 +83,7 @@ test('.self modifier', async () => {
         expect(document.querySelector('span').innerText).toEqual('bar')
     })
 
-    document.querySelector('div').click()
+    document.querySelector('#selfTarget').click()
 
     await wait(() => {
         expect(document.querySelector('span').innerText).toEqual('baz')