Browse Source

Use separate file

Dmitry Bubyakin 5 years ago
parent
commit
9e85814cba
2 changed files with 16 additions and 14 deletions
  1. 0 14
      test/bind.spec.js
  2. 16 0
      test/cloak.spec.js

+ 0 - 14
test/bind.spec.js

@@ -95,17 +95,3 @@ test('boolean attributes set to true are added to element', async () => {
     expect(document.querySelectorAll('input')[2].required).toBeTruthy()
     expect(document.querySelectorAll('input')[3].readOnly).toBeTruthy()
 })
-
-test('x-cloak is removed', async () => {
-    document.body.innerHTML = `
-        <div x-data="{ hidden: true }">
-            <span x-cloak></span>
-        </div>
-    `
-
-    expect(document.querySelector('span').getAttribute('x-cloak')).not.toBeNull()
-
-    projectX.start()
-
-    expect(document.querySelector('span').getAttribute('x-cloak')).toBeNull()
-})

+ 16 - 0
test/cloak.spec.js

@@ -0,0 +1,16 @@
+import projectX from 'projectX'
+import { wait } from 'dom-testing-library'
+
+test('x-cloak is removed', async () => {
+    document.body.innerHTML = `
+        <div x-data="{ hidden: true }">
+            <span x-cloak></span>
+        </div>
+    `
+
+    expect(document.querySelector('span').getAttribute('x-cloak')).not.toBeNull()
+
+    projectX.start()
+
+    await wait(() => { expect(document.querySelector('span').getAttribute('x-cloak')).toBeNull() })
+})