diff options
Diffstat (limited to 'test/attributes/hx-boost.js')
-rw-r--r-- | test/attributes/hx-boost.js | 26 |
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!') + }) }) |