DEV: Await for async helpers (#17942)

Fixes flaky tests. Also, a typo.
This commit is contained in:
Jarek Radosz 2022-08-16 10:48:17 +02:00 committed by GitHub
parent 7673899a6b
commit 655941b79c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 10 deletions

View File

@ -58,9 +58,8 @@ acceptance("Admin - Watched Words", function (needs) {
test("add words", async function (assert) {
await visit("/admin/customize/watched_words/action/block");
click(".show-words-checkbox");
fillIn(".watched-word-form input", "poutine");
await click(".show-words-checkbox");
await fillIn(".watched-word-form input", "poutine");
await click(".watched-word-form button");
let found = [];
@ -74,21 +73,20 @@ acceptance("Admin - Watched Words", function (needs) {
assert.strictEqual(count(".watched-words-list .case-sensitive"), 0);
});
test("add case-sensitve words", async function (assert) {
test("add case-sensitive words", async function (assert) {
await visit("/admin/customize/watched_words/action/block");
click(".show-words-checkbox");
fillIn(".watched-word-form input", "Discourse");
click(".case-sensitivity-checkbox");
await click(".show-words-checkbox");
await fillIn(".watched-word-form input", "Discourse");
await click(".case-sensitivity-checkbox");
await click(".watched-word-form button");
assert
.dom(".watched-words-list .watched-word")
.hasText(`Discourse ${I18n.t("admin.watched_words.case_sensitive")}`);
fillIn(".watched-word-form input", "discourse");
click(".case-sensitivity-checkbox");
await fillIn(".watched-word-form input", "discourse");
await click(".case-sensitivity-checkbox");
await click(".watched-word-form button");
assert