Skip to content

Commit

Permalink
Issue #3396 - Part 4. Add functional tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Taylor committed Aug 26, 2020
1 parent 5abad7b commit 5d6f6db
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions tests/functional/reporting-issue-wizard-non-auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -709,5 +709,55 @@ registerSuite("Reporting with wizard", {
.end()
);
},
"Enter can select category": function () {
return (
FunctionalHelpers.openPage(this, url("issues/new"), "#js-ReportForm")
.findByCssSelector("#url")
.type("http://example.com")
.end()
// Click on "Confirm"
.findByCssSelector(".next-url")
.click()
.end()
.execute(() => {
let label = document.querySelector("#problem_category-0 + label");
let enter = new KeyboardEvent("keydown", {
code: "Enter",
keyCode: 13,
which: 13,
});

label.dispatchEvent(enter);
})
.findByCssSelector("#problem_category-0")
.getProperty("checked")
.then((checkedProp) => {
assert.isTrue(checkedProp);
})
.end()
.execute(() => {
let label2 = document.querySelector("#problem_category-1 + label");
let enter = new KeyboardEvent("keydown", {
code: "Enter",
keyCode: 13,
which: 13,
});

label2.dispatchEvent(enter);
})
.findByCssSelector("#problem_category-0")
.getProperty("checked")
.then((checkedProp) => {
assert.isFalse(checkedProp);
})
.end()
.findByCssSelector("#problem_category-1")
.getProperty("checked")
.then((checkedProp) => {
assert.isTrue(checkedProp);
})
.end()
);
},
},
});

0 comments on commit 5d6f6db

Please sign in to comment.