diff options
author | carson <carson@leaddyno.com> | 2020-06-30 12:17:34 -0700 |
---|---|---|
committer | carson <carson@leaddyno.com> | 2020-06-30 12:17:34 -0700 |
commit | 416ee3dde229ae0c80abc0e15468584fefd8119a (patch) | |
tree | 2457bdfd8ccff961f77b0436806c62f0fc71118f /test/attributes/hx-push-url.js | |
parent | b22b1d104c2a7e7097923c3d7a66e1d19ff56c04 (diff) | |
download | htmx-416ee3dde229ae0c80abc0e15468584fefd8119a.tar.gz htmx-416ee3dde229ae0c80abc0e15468584fefd8119a.zip |
fix test
Diffstat (limited to 'test/attributes/hx-push-url.js')
-rw-r--r-- | test/attributes/hx-push-url.js | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/test/attributes/hx-push-url.js b/test/attributes/hx-push-url.js index a1bad296..206fe934 100644 --- a/test/attributes/hx-push-url.js +++ b/test/attributes/hx-push-url.js @@ -19,10 +19,12 @@ describe("hx-push-url attribute", function() { var div = make('<div hx-push-url="true" hx-get="/test">first</div>'); div.click(); this.server.respond(); + div.click(); + this.server.respond(); getWorkArea().textContent.should.equal("second") var cache = JSON.parse(localStorage.getItem(HTMX_HISTORY_CACHE_NAME)); - cache.length.should.equal(1); - cache[0].url.should.equal("/test"); + cache.length.should.equal(2); + cache[1].url.should.equal("/test"); }); it("navigation should push an element into the cache when string", function () { @@ -31,10 +33,13 @@ describe("hx-push-url attribute", function() { var div = make('<div hx-push-url="/abc123" hx-get="/test">first</div>'); div.click(); this.server.respond(); + div.click(); + this.server.respond(); getWorkArea().textContent.should.equal("second") var cache = JSON.parse(localStorage.getItem(HTMX_HISTORY_CACHE_NAME)); - cache.length.should.equal(1); - cache[0].url.should.equal("/abc123"); + console.log(cache); + cache.length.should.equal(2); + cache[1].url.should.equal("/abc123"); }); it("restore should return old value", function () { @@ -125,7 +130,7 @@ describe("hx-push-url attribute", function() { }); - it("afterSettle.htmx is called when replacing outerHTML", function () { + it("htmx:afterSettle is called when replacing outerHTML", function () { var called = false; var handler = htmx.on("htmx:afterSettle", function (evt) { called = true; |