summaryrefslogtreecommitdiffstatshomepage
path: root/www/static/test/ext/include-vals.js
blob: fc05a067b3bae5bb92cc9986bde6786e4b7c2de6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
describe("include-vals extension", function() {
    beforeEach(function () {
        this.server = makeServer();
        clearWorkArea();
    });
    afterEach(function () {
        this.server.restore();
        clearWorkArea();
    });

    it('Includes values properly', function () {
        var params = {};
        this.server.respondWith("POST", "/test", function (xhr) {
            params = getParameters(xhr);
            xhr.respond(200, {}, "clicked");
        });
        var btn = make('<button hx-post="/test" hx-ext="include-vals" include-vals="foo:\'bar\'">Click Me!</button>')
        btn.click();
        this.server.respond();
        params['foo'].should.equal("bar");
    });

});