mirror of
https://github.com/bigskysoftware/htmx.git
synced 2025-10-02 07:21:05 +00:00
Added test for two values included when not in form
This commit is contained in:
parent
a7d8f444ab
commit
10e068fcaa
@ -77,6 +77,22 @@ describe("hx-include attribute", function() {
|
||||
});
|
||||
|
||||
it('Two inputs are included twice when they have the same name', function () {
|
||||
this.server.respondWith("POST", "/include", function (xhr) {
|
||||
var params = getParameters(xhr);
|
||||
params['i1'].should.deep.equal(["test", "test2"]);
|
||||
xhr.respond(200, {}, "Clicked!")
|
||||
});
|
||||
var div = make('<div hx-target="this">' +
|
||||
'<input hx-post="/include" hx-trigger="click" id="i1" name="i1" value="test"/>' +
|
||||
'<input name="i1" value="test2"/>' +
|
||||
'</div>')
|
||||
var input = byId("i1")
|
||||
input.click();
|
||||
this.server.respond();
|
||||
div.innerHTML.should.equal("Clicked!");
|
||||
});
|
||||
|
||||
it('Two inputs are included twice when in form when they have the same name', function () {
|
||||
this.server.respondWith("POST", "/include", function (xhr) {
|
||||
var params = getParameters(xhr);
|
||||
params['i1'].should.deep.equal(["test", "test2"]);
|
||||
|
Loading…
x
Reference in New Issue
Block a user