mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 03:39:55 +00:00
first PR for #2942 - added new electron tests for calendar which test new css classes from https://github.com/MichMich/MagicMirror/pull/2939 - moved some compliments tests from `e2e` to `electron` because of date mocking - removed mock stuff from compliments module
33 lines
934 B
JavaScript
33 lines
934 B
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) => {
|
|
await helpers.getElement(".calendar");
|
|
await helpers.getElement(".module-content");
|
|
const events = await global.page.locator(".event");
|
|
const elem = await events.locator(cssClass);
|
|
expect(elem).not.toBe(null);
|
|
};
|
|
|
|
afterEach(async () => {
|
|
await helpers.stopApplication();
|
|
});
|
|
|
|
describe("Test css classes", () => {
|
|
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 Dez 2029 12:30:00 GMT");
|
|
await doTest(".tomorrow");
|
|
});
|
|
});
|
|
});
|