mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-08-21 12:55:22 +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:
@@ -4,10 +4,12 @@ describe("Calendar module", () => {
|
||||
/**
|
||||
* move similar tests in function doTest
|
||||
* @param {string} cssClass css selector
|
||||
* @returns {boolean} result
|
||||
*/
|
||||
const doTest = async (cssClass) => {
|
||||
let elem = await helpers.getElement(`.calendar .module-content .event${cssClass}`);
|
||||
await expect(elem.isVisible()).resolves.toBe(true);
|
||||
return true;
|
||||
};
|
||||
|
||||
afterEach(async () => {
|
||||
@@ -17,27 +19,27 @@ describe("Calendar module", () => {
|
||||
describe("Test css classes", () => {
|
||||
it("has css class dayBeforeYesterday", async () => {
|
||||
await helpers.startApplication("tests/configs/modules/calendar/custom.js", "03 Jan 2030 12:30:00 GMT");
|
||||
await doTest(".dayBeforeYesterday");
|
||||
await expect(doTest(".dayBeforeYesterday")).resolves.toBe(true);
|
||||
});
|
||||
|
||||
it("has css class yesterday", async () => {
|
||||
await helpers.startApplication("tests/configs/modules/calendar/custom.js", "02 Jan 2030 12:30:00 GMT");
|
||||
await doTest(".yesterday");
|
||||
await expect(doTest(".yesterday")).resolves.toBe(true);
|
||||
});
|
||||
|
||||
it("has css class today", async () => {
|
||||
await helpers.startApplication("tests/configs/modules/calendar/custom.js", "01 Jan 2030 12:30:00 GMT");
|
||||
await doTest(".today");
|
||||
await expect(doTest(".today")).resolves.toBe(true);
|
||||
});
|
||||
|
||||
it("has css class tomorrow", async () => {
|
||||
await helpers.startApplication("tests/configs/modules/calendar/custom.js", "31 Dec 2029 12:30:00 GMT");
|
||||
await doTest(".tomorrow");
|
||||
await expect(doTest(".tomorrow")).resolves.toBe(true);
|
||||
});
|
||||
|
||||
it("has css class dayAfterTomorrow", async () => {
|
||||
await helpers.startApplication("tests/configs/modules/calendar/custom.js", "30 Dec 2029 12:30:00 GMT");
|
||||
await doTest(".dayAfterTomorrow");
|
||||
await expect(doTest(".dayAfterTomorrow")).resolves.toBe(true);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user