Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions test/commands/toggle.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,15 @@ describe("the toggle command", function () {
div.classList.contains("bar").should.equal(false);
});

it("can toggle between two attribute values", function () {
var div = make("<div _='on click toggle @aria-selected between \"true\" and \"false\"'></div>");
div.getAttribute("aria-selected").should.equal(null);
div.click();
div.getAttribute("aria-selected").should.equal("true");
div.click();
div.getAttribute("aria-selected").should.equal("false");
});

it("can toggle multiple class refs", function () {
var div = make("<div class='bar' _='on click toggle .foo .bar'></div>");
div.classList.contains("foo").should.equal(false);
Expand Down