summaryrefslogtreecommitdiffstatshomepage
path: root/test/attributes/hx-classes.js
diff options
context:
space:
mode:
authorcarson <carson@leaddyno.com>2020-05-23 04:52:52 -0700
committercarson <carson@leaddyno.com>2020-05-23 04:52:52 -0700
commitba6d38e9dd0f61cca373e2e660c99b5e23f73a6b (patch)
treeb90aebcc597706a3e5cb4509924c13b1e5ad3d0e /test/attributes/hx-classes.js
parent8b6aec296013588e7acc64eab5878f1cef818f1b (diff)
downloadhtmx-ba6d38e9dd0f61cca373e2e660c99b5e23f73a6b.tar.gz
htmx-ba6d38e9dd0f61cca373e2e660c99b5e23f73a6b.zip
Fix https://github.com/bigskysoftware/htmx/issues/19
clean up uses of getRawAttribute() and add a `data-*` test for all attribute tests.
Diffstat (limited to 'test/attributes/hx-classes.js')
-rw-r--r--test/attributes/hx-classes.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/attributes/hx-classes.js b/test/attributes/hx-classes.js
index a138976e..00dc5cfb 100644
--- a/test/attributes/hx-classes.js
+++ b/test/attributes/hx-classes.js
@@ -29,4 +29,16 @@ describe("hx-classes attribute", function(){
done();
}, 100);
});
+
+ it('adds classes properly w/ data-* prefix', function(done)
+ {
+ var div = make('<div data-hx-classes="add c1">Click Me!</div>')
+ should.equal(div.classList.length, 0);
+ setTimeout(function(){
+ should.equal(div.classList.contains("c1"), true);
+ done();
+ }, 100);
+ });
+
+
})