mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-08-21 12:55:22 +00:00
added new electron tests supporting date mocking (#2947)
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
This commit is contained in:
@@ -18,37 +18,6 @@ describe("Compliments module", () => {
|
||||
await helpers.stopApplication();
|
||||
});
|
||||
|
||||
describe("parts of days", () => {
|
||||
beforeAll(async () => {
|
||||
helpers.startApplication("tests/configs/modules/compliments/compliments_parts_day.js");
|
||||
await helpers.getDocument();
|
||||
});
|
||||
|
||||
it("if Morning compliments for that part of day", async () => {
|
||||
const hour = new Date().getHours();
|
||||
if (hour >= 3 && hour < 12) {
|
||||
// if morning check
|
||||
await doTest(["Hi", "Good Morning", "Morning test"]);
|
||||
}
|
||||
});
|
||||
|
||||
it("if Afternoon show Compliments for that part of day", async () => {
|
||||
const hour = new Date().getHours();
|
||||
if (hour >= 12 && hour < 17) {
|
||||
// if afternoon check
|
||||
await doTest(["Hello", "Good Afternoon", "Afternoon test"]);
|
||||
}
|
||||
});
|
||||
|
||||
it("if Evening show Compliments for that part of day", async () => {
|
||||
const hour = new Date().getHours();
|
||||
if (!(hour >= 3 && hour < 12) && !(hour >= 12 && hour < 17)) {
|
||||
// if evening check
|
||||
await doTest(["Hello There", "Good Evening", "Evening test"]);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
describe("Feature anytime in compliments module", () => {
|
||||
describe("Set anytime and empty compliments for morning, evening and afternoon ", () => {
|
||||
beforeAll(async () => {
|
||||
@@ -73,19 +42,6 @@ describe("Compliments module", () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("Feature date in compliments module", () => {
|
||||
describe("Set date and empty compliments for anytime, morning, evening and afternoon", () => {
|
||||
beforeAll(async () => {
|
||||
helpers.startApplication("tests/configs/modules/compliments/compliments_date.js");
|
||||
await helpers.getDocument();
|
||||
});
|
||||
|
||||
it("Show happy new year compliment on new years day", async () => {
|
||||
await doTest(["Happy new year!"]);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("remoteFile option", () => {
|
||||
beforeAll(async () => {
|
||||
helpers.startApplication("tests/configs/modules/compliments/compliments_remote.js");
|
||||
|
Reference in New Issue
Block a user