describe("hx-vals attribute", function() { beforeEach(function () { this.server = makeServer(); clearWorkArea(); }); afterEach(function () { this.server.restore(); clearWorkArea(); }); it('basic hx-vals works', function () { this.server.respondWith("POST", "/vars", function (xhr) { var params = getParameters(xhr); params['i1'].should.equal("test"); xhr.respond(200, {}, "Clicked!") }); var div = make("
") div.click(); this.server.respond(); div.innerHTML.should.equal("Clicked!"); }); it('basic hx-vals works with braces', function () { this.server.respondWith("POST", "/vars", function (xhr) { var params = getParameters(xhr); params['i1'].should.equal("test"); xhr.respond(200, {}, "Clicked!") }); var div = make("") div.click(); this.server.respond(); div.innerHTML.should.equal("Clicked!"); }); it('multiple hx-vals works', function () { this.server.respondWith("POST", "/vars", function (xhr) { var params = getParameters(xhr); params['v1'].should.equal("test"); params['v2'].should.equal("42"); xhr.respond(200, {}, "Clicked!") }); var div = make("") div.click(); this.server.respond(); div.innerHTML.should.equal("Clicked!"); }); it('hx-vals can be on parents', function () { this.server.respondWith("POST", "/vars", function (xhr) { var params = getParameters(xhr); params['i1'].should.equal("test"); xhr.respond(200, {}, "Clicked!") }); make("