mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 03:39:55 +00:00
We have used it inconsistently till now. Template literals are more modern and easier to maintain in my opinion. Because that's a large amount of changes, here's a way to reproduce it: I added the rule `"prefer-template": "error"` to the `.eslintrc.json` and did an autofix. Since this caused a new problem in line 409 of `newsfeed.js`, I reversed it in that line and also removed the rule from the eslint config file. The rule is described here: https://eslint.org/docs/latest/rules/prefer-template Note: I've played around with some other linter rules as well, and some seem to point to some specific, non-cosmetic, issues. But before I dive even deeper and then introduce even bigger and hardly understandable changes at once, I thought I'd start with this simple cosmetic rule.
45 lines
1.4 KiB
JavaScript
45 lines
1.4 KiB
JavaScript
const helpers = require("../helpers/global-setup");
|
|
|
|
describe("Calendar module", () => {
|
|
/**
|
|
* move similar tests in function doTest
|
|
*
|
|
* @param {string} cssClass css selector
|
|
*/
|
|
const doTest = async (cssClass) => {
|
|
let elem = await helpers.getElement(`.calendar .module-content .event${cssClass}`);
|
|
expect(await elem.isVisible()).toBe(true);
|
|
};
|
|
|
|
afterEach(async () => {
|
|
await helpers.stopApplication();
|
|
});
|
|
|
|
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");
|
|
});
|
|
|
|
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");
|
|
});
|
|
|
|
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");
|
|
});
|
|
|
|
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");
|
|
});
|
|
|
|
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");
|
|
});
|
|
});
|
|
});
|