DEV: Fix test flakyness (#305)

This commit is contained in:
Jarek Radosz 2022-07-26 03:18:09 +02:00 committed by GitHub
parent 799c3515ce
commit 3c5e9f3e1d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 13 deletions

View File

@ -26,21 +26,21 @@ acceptance("Post event - composer", function (needs) {
);
await timezoneInput.expand();
await timezoneInput.selectRowByValue("Europe/London");
assert.equal(
assert.strictEqual(
timezoneInput.header().value(),
"Europe/London",
"Timezone can be changed"
);
const fromDate = query(`${modal} .from input[type=date]`);
fillIn(fromDate, "2022-07-01");
await fillIn(fromDate, "2022-07-01");
const fromTime = selectKit(`${modal} .from .d-time-input .select-kit`);
await fromTime.expand();
await fromTime.selectRowByName("12:00");
const toDate = query(`${modal} .to input[type=date]`);
fillIn(toDate, "2022-07-01");
await fillIn(toDate, "2022-07-01");
const toTime = selectKit(`${modal} .to .d-time-input .select-kit`);
await toTime.expand();
await toTime.selectRowByName("13:00");

View File

@ -31,7 +31,7 @@ discourseModule(
async test(assert) {
assert.equal(
query("button").innerText,
query("button").innerText.trim(),
"Enable",
"it displays an enable button"
);
@ -56,7 +56,7 @@ discourseModule(
async test(assert) {
assert.equal(
query("button").innerText,
query("button").innerText.trim(),
"Disable",
"it displays a disable button"
);

View File

@ -20,24 +20,24 @@ discourseModule(
},
async test(assert) {
assert.equal(
query("table tbody tr:nth-child(1) td:nth-child(1)").innerText,
assert.strictEqual(
query("table tbody tr:nth-child(1) td:nth-child(1)").innerText.trim(),
"2022-01-01",
"it displays the first holiday date"
);
assert.equal(
query("table tbody tr:nth-child(1) td:nth-child(2)").innerText,
assert.strictEqual(
query("table tbody tr:nth-child(1) td:nth-child(2)").innerText.trim(),
"New Year's Day",
"it displays the first holiday name"
);
assert.equal(
query("table tbody tr:nth-child(2) td:nth-child(1)").innerText,
assert.strictEqual(
query("table tbody tr:nth-child(2) td:nth-child(1)").innerText.trim(),
"2022-01-17",
"it displays the second holiday date"
);
assert.equal(
query("table tbody tr:nth-child(2) td:nth-child(2)").innerText,
assert.strictEqual(
query("table tbody tr:nth-child(2) td:nth-child(2)").innerText.trim(),
"Martin Luther King, Jr. Day",
"it displays the second holiday name"
);