diff --git a/tests/configs/modules/clock/clock_showTime.js b/tests/configs/modules/clock/clock_showTime.js new file mode 100644 index 00000000..93dd83de --- /dev/null +++ b/tests/configs/modules/clock/clock_showTime.js @@ -0,0 +1,23 @@ +/* Magic Mirror Test config for default clock module + * + * By Johan Hammar + * MIT Licensed. + */ +let config = require(process.cwd() + "/tests/configs/default.js").configFactory({ + timeFormat: 12, + + modules: [ + { + module: "clock", + position: "middle_center", + config: { + showTime: false + } + } + ] +}); + +/*************** DO NOT EDIT THE LINE BELOW ***************/ +if (typeof module !== "undefined") { + module.exports = config; +} diff --git a/tests/e2e/modules/clock_spec.js b/tests/e2e/modules/clock_spec.js index 473c6f6a..57a2fa65 100644 --- a/tests/e2e/modules/clock_spec.js +++ b/tests/e2e/modules/clock_spec.js @@ -85,6 +85,20 @@ describe("Clock module", function () { }); }); + describe("with showTime config disabled", function () { + beforeAll(function () { + // Set config sample for use in test + process.env.MM_CONFIG_FILE = "tests/configs/modules/clock/clock_showTime.js"; + }); + + it("should show not show the time when digital clock is shown", async function () { + await app.client.waitUntilWindowLoaded(); + const digital = await app.client.$(".clock .digital"); + const time = await digital.$$(".time"); + return expect(time.length).toBe(0); + }); + }); + describe("with showWeek config enabled", function () { beforeAll(function () { // Set config sample for use in test