Add test for showTime parameter

This commit is contained in:
rejas 2021-08-29 20:00:42 +02:00
parent 8589d9c482
commit c41fff8f5c
2 changed files with 37 additions and 0 deletions

View File

@ -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;
}

View File

@ -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