summaryrefslogtreecommitdiffstatshomepage
path: root/test
diff options
context:
space:
mode:
authorcarson <carson@leaddyno.com>2020-06-16 19:20:23 -0700
committercarson <carson@leaddyno.com>2020-06-16 19:20:23 -0700
commit19b933449b1af4d4589bee24ae201dbe0c8d374f (patch)
tree887fac6f3cc417215427a08b90271b35a3fa6f73 /test
parentefd3ab85f0f921bca1fde539af65216df7657386 (diff)
downloadhtmx-19b933449b1af4d4589bee24ae201dbe0c8d374f.tar.gz
htmx-19b933449b1af4d4589bee24ae201dbe0c8d374f.zip
catch empty IDs in attribute swap, fixes https://github.com/bigskysoftware/htmx/issues/101
Diffstat (limited to 'test')
-rw-r--r--test/core/regressions.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/test/core/regressions.js b/test/core/regressions.js
index ccb3d240..a3108fdb 100644
--- a/test/core/regressions.js
+++ b/test/core/regressions.js
@@ -49,7 +49,7 @@ describe("Core htmx Regression Tests", function(){
form.innerHTML.should.equal("variable=")
});
- it ('name=id doesnt cause an error, function()', function(){
+ it ('name=id doesnt cause an error', function(){
this.server.respondWith("GET", "/test", "Foo<form><input name=\"id\"/></form>")
var div = make('<div hx-get="/test">Get It</div>')
div.click();
@@ -57,4 +57,12 @@ describe("Core htmx Regression Tests", function(){
div.innerText.should.equal("Foo")
});
+ it ('empty id doesnt cause an error', function(){
+ this.server.respondWith("GET", "/test", "Foo<div id=''></div>")
+ var div = make('<div hx-get="/test">Get It</div>')
+ div.click();
+ this.server.respond();
+ div.innerText.should.equal("Foo")
+ });
+
})