浏览代码

Remove stale array binding test

Caleb Porzio 5 年之前
父节点
当前提交
e442f8bcb8
共有 3 个文件被更改,包括 2 次插入12 次删除
  1. 0 0
      dist/alpine.js.map
  2. 2 0
      src/component.js
  3. 0 12
      test/bind.spec.js

文件差异内容过多而无法显示
+ 0 - 0
dist/alpine.js.map


+ 2 - 0
src/component.js

@@ -112,6 +112,8 @@ export default class Component {
     }
 
     initializeElement(el) {
+        // To support class attribute merging, we have to know what the element's
+        // original class attribute looked like for reference.
         if (el.hasAttribute('class') && getXAttrs(el).length > 0) {
             el.__originalClasses = el.getAttribute('class').split(' ')
         }

+ 0 - 12
test/bind.spec.js

@@ -138,18 +138,6 @@ test('class attribute bindings are added by nested object syntax', async () => {
     expect(document.querySelector('span').classList.contains('foo')).toBeTruthy()
 })
 
-test('class attribute bindings are removed by array syntax', async () => {
-    document.body.innerHTML = `
-        <div x-data="{}">
-            <span class="foo" x-bind:class="[]"></span>
-        </div>
-    `
-
-    Alpine.start()
-
-    expect(document.querySelector('span').classList.contains('foo')).toBeFalsy()
-})
-
 test('class attribute bindings are added by array syntax', async () => {
     document.body.innerHTML = `
         <div x-data="{}">

部分文件因为文件数量过多而无法显示