mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-08-24 14:05:12 +00:00
enable eslint jest/expect-expect and jest/no-done-callback (#3272)
follow up to https://github.com/MichMich/MagicMirror/pull/3270
This commit is contained in:
@@ -6,6 +6,7 @@ describe("Calendar module", () => {
|
||||
* @param {string} element css selector
|
||||
* @param {string} result expected number
|
||||
* @param {string} not reverse result
|
||||
* @returns {boolean} result
|
||||
*/
|
||||
const testElementLength = async (element, result, not) => {
|
||||
const elem = await helpers.waitForAllElements(element);
|
||||
@@ -15,12 +16,14 @@ describe("Calendar module", () => {
|
||||
} else {
|
||||
expect(elem).toHaveLength(result);
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
const testTextContain = async (element, text) => {
|
||||
const elem = await helpers.waitForElement(element, "undefinedLoading");
|
||||
expect(elem).not.toBeNull();
|
||||
expect(elem.textContent).toContain(text);
|
||||
return true;
|
||||
};
|
||||
|
||||
afterAll(async () => {
|
||||
@@ -34,11 +37,11 @@ describe("Calendar module", () => {
|
||||
});
|
||||
|
||||
it("should show the default maximumEntries of 10", async () => {
|
||||
await testElementLength(".calendar .event", 10);
|
||||
await expect(testElementLength(".calendar .event", 10)).resolves.toBe(true);
|
||||
});
|
||||
|
||||
it("should show the default calendar symbol in each event", async () => {
|
||||
await testElementLength(".calendar .event .fa-calendar-alt", 0, "not");
|
||||
await expect(testElementLength(".calendar .event .fa-calendar-alt", 0, "not")).resolves.toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -49,27 +52,27 @@ describe("Calendar module", () => {
|
||||
});
|
||||
|
||||
it("should show the custom maximumEntries of 5", async () => {
|
||||
await testElementLength(".calendar .event", 5);
|
||||
await expect(testElementLength(".calendar .event", 5)).resolves.toBe(true);
|
||||
});
|
||||
|
||||
it("should show the custom calendar symbol in four events", async () => {
|
||||
await testElementLength(".calendar .event .fa-birthday-cake", 4);
|
||||
await expect(testElementLength(".calendar .event .fa-birthday-cake", 4)).resolves.toBe(true);
|
||||
});
|
||||
|
||||
it("should show a customEvent calendar symbol in one event", async () => {
|
||||
await testElementLength(".calendar .event .fa-dice", 1);
|
||||
await expect(testElementLength(".calendar .event .fa-dice", 1)).resolves.toBe(true);
|
||||
});
|
||||
|
||||
it("should show a customEvent calendar eventClass in one event", async () => {
|
||||
await testElementLength(".calendar .event.undo", 1);
|
||||
await expect(testElementLength(".calendar .event.undo", 1)).resolves.toBe(true);
|
||||
});
|
||||
|
||||
it("should show two custom icons for repeating events", async () => {
|
||||
await testElementLength(".calendar .event .fa-undo", 2);
|
||||
await expect(testElementLength(".calendar .event .fa-undo", 2)).resolves.toBe(true);
|
||||
});
|
||||
|
||||
it("should show two custom icons for day events", async () => {
|
||||
await testElementLength(".calendar .event .fa-calendar-day", 2);
|
||||
await expect(testElementLength(".calendar .event .fa-calendar-day", 2)).resolves.toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -80,7 +83,7 @@ describe("Calendar module", () => {
|
||||
});
|
||||
|
||||
it("should show the recurring birthday event 6 times", async () => {
|
||||
await testElementLength(".calendar .event", 6);
|
||||
await expect(testElementLength(".calendar .event", 6)).resolves.toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -91,7 +94,7 @@ describe("Calendar module", () => {
|
||||
});
|
||||
|
||||
it("should show the recurring event 51 times (excluded once) in a 364-day (inclusive) period", async () => {
|
||||
await testElementLength(".calendar .event", 51);
|
||||
await expect(testElementLength(".calendar .event", 51)).resolves.toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -102,7 +105,7 @@ describe("Calendar module", () => {
|
||||
});
|
||||
|
||||
it("should show multiple events with the same title and start time from different calendars", async () => {
|
||||
await testElementLength(".calendar .event", 22);
|
||||
await expect(testElementLength(".calendar .event", 22)).resolves.toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -118,7 +121,7 @@ describe("Calendar module", () => {
|
||||
});
|
||||
|
||||
it(`should contain text "Mar 25th" in timezone UTC ${-i}`, async () => {
|
||||
await testTextContain(".calendar", "Mar 25th");
|
||||
await expect(testTextContain(".calendar", "Mar 25th")).resolves.toBe(true);
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -135,7 +138,7 @@ describe("Calendar module", () => {
|
||||
});
|
||||
|
||||
it("should return TestEvents", async () => {
|
||||
await testElementLength(".calendar .event", 0, "not");
|
||||
await expect(testElementLength(".calendar .event", 0, "not")).resolves.toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -146,7 +149,7 @@ describe("Calendar module", () => {
|
||||
});
|
||||
|
||||
it("should return TestEvents", async () => {
|
||||
await testElementLength(".calendar .event", 0, "not");
|
||||
await expect(testElementLength(".calendar .event", 0, "not")).resolves.toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -157,7 +160,7 @@ describe("Calendar module", () => {
|
||||
});
|
||||
|
||||
it("should return TestEvents", async () => {
|
||||
await testElementLength(".calendar .event", 0, "not");
|
||||
await expect(testElementLength(".calendar .event", 0, "not")).resolves.toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -168,7 +171,7 @@ describe("Calendar module", () => {
|
||||
});
|
||||
|
||||
it("should return TestEvents", async () => {
|
||||
await testElementLength(".calendar .event", 0, "not");
|
||||
await expect(testElementLength(".calendar .event", 0, "not")).resolves.toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -184,7 +187,7 @@ describe("Calendar module", () => {
|
||||
});
|
||||
|
||||
it("should show Unauthorized error", async () => {
|
||||
await testTextContain(".calendar", "Error in the calendar module. Authorization failed");
|
||||
await expect(testTextContain(".calendar", "Error in the calendar module. Authorization failed")).resolves.toBe(true);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@@ -13,12 +13,12 @@ describe("Clock set to spanish language module", () => {
|
||||
|
||||
it("shows date with correct format", async () => {
|
||||
const dateRegex = /^(?:lunes|martes|miércoles|jueves|viernes|sábado|domingo), \d{1,2} de (?:enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre) de \d{4}$/;
|
||||
await helpers.testMatch(".clock .date", dateRegex);
|
||||
await expect(helpers.testMatch(".clock .date", dateRegex)).resolves.toBe(true);
|
||||
});
|
||||
|
||||
it("shows time in 24hr format", async () => {
|
||||
const timeRegex = /^(?:2[0-3]|[01]\d):[0-5]\d[0-5]\d$/;
|
||||
await helpers.testMatch(".clock .time", timeRegex);
|
||||
await expect(helpers.testMatch(".clock .time", timeRegex)).resolves.toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -30,12 +30,12 @@ describe("Clock set to spanish language module", () => {
|
||||
|
||||
it("shows date with correct format", async () => {
|
||||
const dateRegex = /^(?:lunes|martes|miércoles|jueves|viernes|sábado|domingo), \d{1,2} de (?:enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre) de \d{4}$/;
|
||||
await helpers.testMatch(".clock .date", dateRegex);
|
||||
await expect(helpers.testMatch(".clock .date", dateRegex)).resolves.toBe(true);
|
||||
});
|
||||
|
||||
it("shows time in 12hr format", async () => {
|
||||
const timeRegex = /^(?:1[0-2]|[1-9]):[0-5]\d[0-5]\d[ap]m$/;
|
||||
await helpers.testMatch(".clock .time", timeRegex);
|
||||
await expect(helpers.testMatch(".clock .time", timeRegex)).resolves.toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -47,7 +47,7 @@ describe("Clock set to spanish language module", () => {
|
||||
|
||||
it("shows 12hr time with upper case AM/PM", async () => {
|
||||
const timeRegex = /^(?:1[0-2]|[1-9]):[0-5]\d[0-5]\d[AP]M$/;
|
||||
await helpers.testMatch(".clock .time", timeRegex);
|
||||
await expect(helpers.testMatch(".clock .time", timeRegex)).resolves.toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -59,7 +59,7 @@ describe("Clock set to spanish language module", () => {
|
||||
|
||||
it("shows week with correct format", async () => {
|
||||
const weekRegex = /^Semana [0-9]{1,2}$/;
|
||||
await helpers.testMatch(".clock .week", weekRegex);
|
||||
await expect(helpers.testMatch(".clock .week", weekRegex)).resolves.toBe(true);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@@ -14,12 +14,12 @@ describe("Clock module", () => {
|
||||
|
||||
it("should show the date in the correct format", async () => {
|
||||
const dateRegex = /^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (?:January|February|March|April|May|June|July|August|September|October|November|December) \d{1,2}, \d{4}$/;
|
||||
await helpers.testMatch(".clock .date", dateRegex);
|
||||
await expect(helpers.testMatch(".clock .date", dateRegex)).resolves.toBe(true);
|
||||
});
|
||||
|
||||
it("should show the time in 24hr format", async () => {
|
||||
const timeRegex = /^(?:2[0-3]|[01]\d):[0-5]\d[0-5]\d$/;
|
||||
await helpers.testMatch(".clock .time", timeRegex);
|
||||
await expect(helpers.testMatch(".clock .time", timeRegex)).resolves.toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -31,12 +31,12 @@ describe("Clock module", () => {
|
||||
|
||||
it("should show the date in the correct format", async () => {
|
||||
const dateRegex = /^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (?:January|February|March|April|May|June|July|August|September|October|November|December) \d{1,2}, \d{4}$/;
|
||||
await helpers.testMatch(".clock .date", dateRegex);
|
||||
await expect(helpers.testMatch(".clock .date", dateRegex)).resolves.toBe(true);
|
||||
});
|
||||
|
||||
it("should show the time in 12hr format", async () => {
|
||||
const timeRegex = /^(?:1[0-2]|[1-9]):[0-5]\d[0-5]\d[ap]m$/;
|
||||
await helpers.testMatch(".clock .time", timeRegex);
|
||||
await expect(helpers.testMatch(".clock .time", timeRegex)).resolves.toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -48,7 +48,7 @@ describe("Clock module", () => {
|
||||
|
||||
it("should show 12hr time with upper case AM/PM", async () => {
|
||||
const timeRegex = /^(?:1[0-2]|[1-9]):[0-5]\d[0-5]\d[AP]M$/;
|
||||
await helpers.testMatch(".clock .time", timeRegex);
|
||||
await expect(helpers.testMatch(".clock .time", timeRegex)).resolves.toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -60,7 +60,7 @@ describe("Clock module", () => {
|
||||
|
||||
it("should show 12hr time without seconds am/pm", async () => {
|
||||
const timeRegex = /^(?:1[0-2]|[1-9]):[0-5]\d[ap]m$/;
|
||||
await helpers.testMatch(".clock .time", timeRegex);
|
||||
await expect(helpers.testMatch(".clock .time", timeRegex)).resolves.toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -101,7 +101,7 @@ describe("Clock module", () => {
|
||||
|
||||
it("should show the week in the correct format", async () => {
|
||||
const weekRegex = /^Week [0-9]{1,2}$/;
|
||||
await helpers.testMatch(".clock .week", weekRegex);
|
||||
await expect(helpers.testMatch(".clock .week", weekRegex)).resolves.toBe(true);
|
||||
});
|
||||
|
||||
it("should show the week with the correct number of week of year", async () => {
|
||||
|
@@ -4,6 +4,7 @@ describe("Compliments module", () => {
|
||||
/**
|
||||
* move similar tests in function doTest
|
||||
* @param {Array} complimentsArray The array of compliments.
|
||||
* @returns {boolean} result
|
||||
*/
|
||||
const doTest = async (complimentsArray) => {
|
||||
let elem = await helpers.waitForElement(".compliments");
|
||||
@@ -11,6 +12,7 @@ describe("Compliments module", () => {
|
||||
elem = await helpers.waitForElement(".module-content");
|
||||
expect(elem).not.toBeNull();
|
||||
expect(complimentsArray).toContain(elem.textContent);
|
||||
return true;
|
||||
};
|
||||
|
||||
afterAll(async () => {
|
||||
@@ -25,7 +27,7 @@ describe("Compliments module", () => {
|
||||
});
|
||||
|
||||
it("shows anytime because if configure empty parts of day compliments and set anytime compliments", async () => {
|
||||
await doTest(["Anytime here"]);
|
||||
await expect(doTest(["Anytime here"])).resolves.toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -36,7 +38,7 @@ describe("Compliments module", () => {
|
||||
});
|
||||
|
||||
it("shows anytime compliments", async () => {
|
||||
await doTest(["Anytime here"]);
|
||||
await expect(doTest(["Anytime here"])).resolves.toBe(true);
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -48,7 +50,7 @@ describe("Compliments module", () => {
|
||||
});
|
||||
|
||||
it("should show compliments from a remote file", async () => {
|
||||
await doTest(["Remote compliment file works!"]);
|
||||
await expect(doTest(["Remote compliment file works!"])).resolves.toBe(true);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@@ -15,15 +15,15 @@ describe("Weather module", () => {
|
||||
});
|
||||
|
||||
it("should render wind speed and wind direction", async () => {
|
||||
await weatherFunc.getText(".weather .normal.medium span:nth-child(2)", "12 WSW");
|
||||
await expect(weatherFunc.getText(".weather .normal.medium span:nth-child(2)", "12 WSW")).resolves.toBe(true);
|
||||
});
|
||||
|
||||
it("should render temperature with icon", async () => {
|
||||
await weatherFunc.getText(".weather .large.light span.bright", "1.5°");
|
||||
await expect(weatherFunc.getText(".weather .large.light span.bright", "1.5°")).resolves.toBe(true);
|
||||
});
|
||||
|
||||
it("should render feels like temperature", async () => {
|
||||
await weatherFunc.getText(".weather .normal.medium.feelslike span.dimmed", "Feels like -5.6°");
|
||||
await expect(weatherFunc.getText(".weather .normal.medium.feelslike span.dimmed", "Feels like -5.6°")).resolves.toBe(true);
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -34,7 +34,7 @@ describe("Weather module", () => {
|
||||
});
|
||||
|
||||
it("should render a compliment based on the current weather", async () => {
|
||||
await weatherFunc.getText(".compliments .module-content span", "snow");
|
||||
await expect(weatherFunc.getText(".compliments .module-content span", "snow")).resolves.toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -44,7 +44,7 @@ describe("Weather module", () => {
|
||||
});
|
||||
|
||||
it("should render windUnits in beaufort", async () => {
|
||||
await weatherFunc.getText(".weather .normal.medium span:nth-child(2)", "6");
|
||||
await expect(weatherFunc.getText(".weather .normal.medium span:nth-child(2)", "6")).resolves.toBe(true);
|
||||
});
|
||||
|
||||
it("should render windDirection with an arrow", async () => {
|
||||
@@ -54,15 +54,15 @@ describe("Weather module", () => {
|
||||
});
|
||||
|
||||
it("should render humidity", async () => {
|
||||
await weatherFunc.getText(".weather .normal.medium span:nth-child(3)", "93.7");
|
||||
await expect(weatherFunc.getText(".weather .normal.medium span:nth-child(3)", "93.7")).resolves.toBe(true);
|
||||
});
|
||||
|
||||
it("should render degreeLabel for temp", async () => {
|
||||
await weatherFunc.getText(".weather .large.light span.bright", "1°C");
|
||||
await expect(weatherFunc.getText(".weather .large.light span.bright", "1°C")).resolves.toBe(true);
|
||||
});
|
||||
|
||||
it("should render degreeLabel for feels like", async () => {
|
||||
await weatherFunc.getText(".weather .normal.medium.feelslike span.dimmed", "Feels like -6°C");
|
||||
await expect(weatherFunc.getText(".weather .normal.medium.feelslike span.dimmed", "Feels like -6°C")).resolves.toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -72,15 +72,15 @@ describe("Weather module", () => {
|
||||
});
|
||||
|
||||
it("should render wind in imperial units", async () => {
|
||||
await weatherFunc.getText(".weather .normal.medium span:nth-child(2)", "26 WSW");
|
||||
await expect(weatherFunc.getText(".weather .normal.medium span:nth-child(2)", "26 WSW")).resolves.toBe(true);
|
||||
});
|
||||
|
||||
it("should render temperatures in fahrenheit", async () => {
|
||||
await weatherFunc.getText(".weather .large.light span.bright", "34,7°");
|
||||
await expect(weatherFunc.getText(".weather .large.light span.bright", "34,7°")).resolves.toBe(true);
|
||||
});
|
||||
|
||||
it("should render 'feels like' in fahrenheit", async () => {
|
||||
await weatherFunc.getText(".weather .normal.medium.feelslike span.dimmed", "Feels like 21,9°");
|
||||
await expect(weatherFunc.getText(".weather .normal.medium.feelslike span.dimmed", "Feels like 21,9°")).resolves.toBe(true);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@@ -16,7 +16,7 @@ describe("Weather module: Weather Forecast", () => {
|
||||
const days = ["Today", "Tomorrow", "Sun", "Mon", "Tue"];
|
||||
for (const [index, day] of days.entries()) {
|
||||
it(`should render day ${day}`, async () => {
|
||||
await weatherFunc.getText(`.weather table.small tr:nth-child(${index + 1}) td:nth-child(1)`, day);
|
||||
await expect(weatherFunc.getText(`.weather table.small tr:nth-child(${index + 1}) td:nth-child(1)`, day)).resolves.toBe(true);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -31,14 +31,14 @@ describe("Weather module: Weather Forecast", () => {
|
||||
const maxTemps = ["24.4°", "21.0°", "22.9°", "23.4°", "20.6°"];
|
||||
for (const [index, temp] of maxTemps.entries()) {
|
||||
it(`should render max temperature ${temp}`, async () => {
|
||||
await weatherFunc.getText(`.weather table.small tr:nth-child(${index + 1}) td:nth-child(3)`, temp);
|
||||
await expect(weatherFunc.getText(`.weather table.small tr:nth-child(${index + 1}) td:nth-child(3)`, temp)).resolves.toBe(true);
|
||||
});
|
||||
}
|
||||
|
||||
const minTemps = ["15.3°", "13.6°", "13.8°", "13.9°", "10.9°"];
|
||||
for (const [index, temp] of minTemps.entries()) {
|
||||
it(`should render min temperature ${temp}`, async () => {
|
||||
await weatherFunc.getText(`.weather table.small tr:nth-child(${index + 1}) td:nth-child(4)`, temp);
|
||||
await expect(weatherFunc.getText(`.weather table.small tr:nth-child(${index + 1}) td:nth-child(4)`, temp)).resolves.toBe(true);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ describe("Weather module: Weather Forecast", () => {
|
||||
const days = ["Fri", "Sat", "Sun", "Mon", "Tue"];
|
||||
for (const [index, day] of days.entries()) {
|
||||
it(`should render day ${day}`, async () => {
|
||||
await weatherFunc.getText(`.weather table.small tr:nth-child(${index + 1}) td:nth-child(1)`, day);
|
||||
await expect(weatherFunc.getText(`.weather table.small tr:nth-child(${index + 1}) td:nth-child(1)`, day)).resolves.toBe(true);
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -86,7 +86,7 @@ describe("Weather module: Weather Forecast", () => {
|
||||
for (const [index, precipitation] of precipitations.entries()) {
|
||||
if (precipitation) {
|
||||
it(`should render precipitation amount ${precipitation}`, async () => {
|
||||
await weatherFunc.getText(`.weather table tr:nth-child(${index + 1}) td.precipitation-amount`, precipitation);
|
||||
await expect(weatherFunc.getText(`.weather table tr:nth-child(${index + 1}) td.precipitation-amount`, precipitation)).resolves.toBe(true);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -101,7 +101,7 @@ describe("Weather module: Weather Forecast", () => {
|
||||
const temperatures = ["75_9°", "69_8°", "73_2°", "74_1°", "69_1°"];
|
||||
for (const [index, temp] of temperatures.entries()) {
|
||||
it(`should render custom decimalSymbol = '_' for temp ${temp}`, async () => {
|
||||
await weatherFunc.getText(`.weather table.small tr:nth-child(${index + 1}) td:nth-child(3)`, temp);
|
||||
await expect(weatherFunc.getText(`.weather table.small tr:nth-child(${index + 1}) td:nth-child(3)`, temp)).resolves.toBe(true);
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -111,7 +111,7 @@ describe("Weather module: Weather Forecast", () => {
|
||||
for (const [index, precipitation] of precipitations.entries()) {
|
||||
if (precipitation) {
|
||||
it(`should render precipitation amount ${precipitation}`, async () => {
|
||||
await weatherFunc.getText(`.weather table.small tr:nth-child(${index + 1}) td.precipitation-amount`, precipitation);
|
||||
await expect(weatherFunc.getText(`.weather table.small tr:nth-child(${index + 1}) td.precipitation-amount`, precipitation)).resolves.toBe(true);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@@ -16,7 +16,7 @@ describe("Weather module: Weather Hourly Forecast", () => {
|
||||
const minTemps = ["7:00 pm", "8:00 pm", "9:00 pm", "10:00 pm", "11:00 pm"];
|
||||
for (const [index, hour] of minTemps.entries()) {
|
||||
it(`should render forecast for hour ${hour}`, async () => {
|
||||
await weatherFunc.getText(`.weather table.small tr:nth-child(${index + 1}) td.day`, hour);
|
||||
await expect(weatherFunc.getText(`.weather table.small tr:nth-child(${index + 1}) td.day`, hour)).resolves.toBe(true);
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -30,7 +30,7 @@ describe("Weather module: Weather Hourly Forecast", () => {
|
||||
const minTemps = ["7:00 pm", "9:00 pm", "11:00 pm", "1:00 am", "3:00 am"];
|
||||
for (const [index, hour] of minTemps.entries()) {
|
||||
it(`should render forecast for hour ${hour}`, async () => {
|
||||
await weatherFunc.getText(`.weather table.small tr:nth-child(${index + 1}) td.day`, hour);
|
||||
await expect(weatherFunc.getText(`.weather table.small tr:nth-child(${index + 1}) td.day`, hour)).resolves.toBe(true);
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -46,7 +46,7 @@ describe("Weather module: Weather Hourly Forecast", () => {
|
||||
for (const [index, amount] of amounts.entries()) {
|
||||
if (amount) {
|
||||
it(`should render precipitation amount ${amount}`, async () => {
|
||||
await weatherFunc.getText(`.weather table.small tr:nth-child(${index + 1}) td.precipitation-amount`, amount);
|
||||
await expect(weatherFunc.getText(`.weather table.small tr:nth-child(${index + 1}) td.precipitation-amount`, amount)).resolves.toBe(true);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -57,7 +57,7 @@ describe("Weather module: Weather Hourly Forecast", () => {
|
||||
for (const [index, pop] of propabilities.entries()) {
|
||||
if (pop) {
|
||||
it(`should render probability ${pop}`, async () => {
|
||||
await weatherFunc.getText(`.weather table.small tr:nth-child(${index + 1}) td.precipitation-prob`, pop);
|
||||
await expect(weatherFunc.getText(`.weather table.small tr:nth-child(${index + 1}) td.precipitation-prob`, pop)).resolves.toBe(true);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user