summaryrefslogtreecommitdiffstatshomepage
path: root/test/attributes/hx-include.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-include.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-include.js')
-rw-r--r--test/attributes/hx-include.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/attributes/hx-include.js b/test/attributes/hx-include.js
index 7a75684f..1d00f25d 100644
--- a/test/attributes/hx-include.js
+++ b/test/attributes/hx-include.js
@@ -136,4 +136,18 @@ describe("hx-include attribute", function() {
div.innerHTML.should.equal("Clicked!");
});
+ it('By default an input includes itself w/ data-* prefix', function () {
+ this.server.respondWith("POST", "/include", function (xhr) {
+ var params = getParameters(xhr);
+ params['i1'].should.equal("test");
+ xhr.respond(200, {}, "Clicked!")
+ });
+ var div = make('<div data-hx-target="this"><input data-hx-post="/include" data-hx-trigger="click" id="i1" name="i1" value="test"/></div>')
+ var input = byId("i1")
+ input.click();
+ this.server.respond();
+ div.innerHTML.should.equal("Clicked!");
+ });
+
+
}); \ No newline at end of file