Browse Source

adds integration test for numeric attributes

danprince 5 years ago
parent
commit
3bdf961fb3
1 changed files with 14 additions and 0 deletions
  1. 14 0
      test/bind.spec.js

+ 14 - 0
test/bind.spec.js

@@ -495,3 +495,17 @@ test('.camel modifier correctly sets name of attribute', async () => {
 
     expect(document.querySelector('svg').getAttribute('viewBox')).toEqual('0 0 42 42')
 })
+
+
+test('attribute binding names can contain numbers', async () => {
+    document.body.innerHTML = `
+        <svg x-data>
+            <line x1="1" y1="2" :x2="3" x-bind:y2="4" />
+        </svg>
+    `;
+
+    Alpine.start();
+
+    expect(document.querySelector('line').getAttribute('x2')).toEqual('3');
+    expect(document.querySelector('line').getAttribute('y2')).toEqual('4');
+})