summaryrefslogtreecommitdiffstatshomepage
path: root/test
diff options
context:
space:
mode:
authoryoussame <youssefameachaq@gmail.com>2024-10-20 23:37:58 +0100
committerGitHub <noreply@github.com>2024-10-20 16:37:58 -0600
commit3e265ea263e4c55462e6be8506c765cb23ee3f46 (patch)
tree6f8b7e4a7682de2e227ee5e6a3cd91641937b612 /test
parentf0964d2d0857198fa14f0263e29a4fc0026a3206 (diff)
downloadhtmx-3e265ea263e4c55462e6be8506c765cb23ee3f46.tar.gz
htmx-3e265ea263e4c55462e6be8506c765cb23ee3f46.zip
Fix TypeError on null path variable (#2967)
* Fix the error * add tests
Diffstat (limited to 'test')
-rw-r--r--test/attributes/hx-boost.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/attributes/hx-boost.js b/test/attributes/hx-boost.js
index 20b49f63..2b1928f3 100644
--- a/test/attributes/hx-boost.js
+++ b/test/attributes/hx-boost.js
@@ -143,4 +143,30 @@ describe('hx-boost attribute', function() {
this.server.respond()
div.innerHTML.should.equal('Boosted!')
})
+
+ it('form get with an unset action property', function() {
+ this.server.respondWith('GET', /\/*/, function(xhr) {
+ should.equal(undefined, getParameters(xhr).foo)
+ xhr.respond(200, {}, 'Boosted!')
+ })
+
+ var div = make('<div hx-target="this" hx-boost="true"><form id="f1" method="get"><button id="b1">Submit</button></form></div>')
+ var btn = byId('b1')
+ btn.click()
+ this.server.respond()
+ div.innerHTML.should.equal('Boosted!')
+ })
+
+ it('form get with an empty action property', function() {
+ this.server.respondWith('GET', /\/*/, function(xhr) {
+ should.equal(undefined, getParameters(xhr).foo)
+ xhr.respond(200, {}, 'Boosted!')
+ })
+
+ var div = make('<div hx-target="this" hx-boost="true"><form id="f1" action="" method="get"><button id="b1">Submit</button></form></div>')
+ var btn = byId('b1')
+ btn.click()
+ this.server.respond()
+ div.innerHTML.should.equal('Boosted!')
+ })
})