summaryrefslogtreecommitdiffstatshomepage
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/core/events.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/core/events.js b/test/core/events.js
index 37218510..4bb1674d 100644
--- a/test/core/events.js
+++ b/test/core/events.js
@@ -63,6 +63,20 @@ describe("Core htmx Events", function() {
}
});
+ it("events are only dispatched once if kebab and camel case match", function () {
+ var invoked = 0;
+ var handler = htmx.on("custom", function () {
+ invoked = invoked + 1
+ });
+ try {
+ var div = make("<div hx-post='/test'></div>");
+ htmx.trigger(div, "custom");
+ invoked.should.equal(1);
+ } finally {
+ htmx.off("custom", handler);
+ }
+ });
+
it("htmx:configRequest allows attribute removal", function () {
var param = "foo";
var handler = htmx.on("htmx:configRequest", function (evt) {