From 10e068fcaa4bdcf3190a9eb818064dc08ba8f7a4 Mon Sep 17 00:00:00 2001 From: Ben Croker <57572400+bencroker@users.noreply.github.com> Date: Fri, 22 Jan 2021 09:32:52 +0100 Subject: [PATCH] Added test for two values included when not in form --- test/attributes/hx-include.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/attributes/hx-include.js b/test/attributes/hx-include.js index b7c8a826..8f4b3be3 100644 --- a/test/attributes/hx-include.js +++ b/test/attributes/hx-include.js @@ -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('
' + + '' + + '' + + '
') + 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"]);