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.expand();
await timezoneInput.selectRowByValue("Europe/London"); await timezoneInput.selectRowByValue("Europe/London");
assert.equal( assert.strictEqual(
timezoneInput.header().value(), timezoneInput.header().value(),
"Europe/London", "Europe/London",
"Timezone can be changed" "Timezone can be changed"
); );
const fromDate = query(`${modal} .from input[type=date]`); 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`); const fromTime = selectKit(`${modal} .from .d-time-input .select-kit`);
await fromTime.expand(); await fromTime.expand();
await fromTime.selectRowByName("12:00"); await fromTime.selectRowByName("12:00");
const toDate = query(`${modal} .to input[type=date]`); 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`); const toTime = selectKit(`${modal} .to .d-time-input .select-kit`);
await toTime.expand(); await toTime.expand();
await toTime.selectRowByName("13:00"); await toTime.selectRowByName("13:00");

View File

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

View File

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