2022-10-17 07:20:23 +02:00
|
|
|
const helpers = require("../helpers/global-setup");
|
|
|
|
|
|
|
|
describe("Calendar module", () => {
|
|
|
|
/**
|
|
|
|
* move similar tests in function doTest
|
|
|
|
* @param {string} cssClass css selector
|
|
|
|
*/
|
|
|
|
const doTest = async (cssClass) => {
|
2023-03-19 14:32:23 +01:00
|
|
|
let elem = await helpers.getElement(`.calendar .module-content .event${cssClass}`);
|
2023-02-07 00:03:08 +01:00
|
|
|
expect(await elem.isVisible()).toBe(true);
|
2022-10-17 07:20:23 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
afterEach(async () => {
|
|
|
|
await helpers.stopApplication();
|
|
|
|
});
|
|
|
|
|
|
|
|
describe("Test css classes", () => {
|
2023-02-21 22:39:21 +01:00
|
|
|
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");
|
|
|
|
});
|
|
|
|
|
2022-10-17 07:20:23 +02:00
|
|
|
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 () => {
|
2023-02-07 00:03:08 +01:00
|
|
|
await helpers.startApplication("tests/configs/modules/calendar/custom.js", "31 Dec 2029 12:30:00 GMT");
|
2022-10-17 07:20:23 +02:00
|
|
|
await doTest(".tomorrow");
|
|
|
|
});
|
2023-02-21 22:39:21 +01:00
|
|
|
|
|
|
|
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");
|
|
|
|
});
|
2022-10-17 07:20:23 +02:00
|
|
|
});
|
|
|
|
});
|