summaryrefslogtreecommitdiffstatshomepage
path: root/test/attributes/hx-indicator.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/attributes/hx-indicator.js')
-rw-r--r--test/attributes/hx-indicator.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/attributes/hx-indicator.js b/test/attributes/hx-indicator.js
index 7b1503bf..1385eb42 100644
--- a/test/attributes/hx-indicator.js
+++ b/test/attributes/hx-indicator.js
@@ -33,4 +33,20 @@ describe("hx-indicator attribute", function(){
a1.classList.contains("htmx-request").should.equal(false);
a2.classList.contains("htmx-request").should.equal(false);
});
+
+ it('Indicator classes are properly put on element with explicit indicator w/ data-* prefix', function()
+ {
+ this.server.respondWith("GET", "/test", "Clicked!");
+ var btn = make('<button hx-get="/test" data-hx-indicator="#a1, #a2">Click Me!</button>')
+ var a1 = make('<a id="a1"></a>')
+ var a2 = make('<a id="a2"></a>')
+ btn.click();
+ btn.classList.contains("htmx-request").should.equal(false);
+ a1.classList.contains("htmx-request").should.equal(true);
+ a2.classList.contains("htmx-request").should.equal(true);
+ this.server.respond();
+ btn.classList.contains("htmx-request").should.equal(false);
+ a1.classList.contains("htmx-request").should.equal(false);
+ a2.classList.contains("htmx-request").should.equal(false);
+ });
})