mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 19:53:36 +00:00
Merge pull request #677 from roramirez/test-displayseconds-false-clock
add test with displaySeconds config disabled for clock module
This commit is contained in:
commit
fd738e5c8b
32
tests/configs/modules/clock/clock_displaySeconds_false.js
Normal file
32
tests/configs/modules/clock/clock_displaySeconds_false.js
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
/* Magic Mirror Test config for default clock module
|
||||||
|
*
|
||||||
|
* By Rodrigo Ramírez Norambuena https://rodrigoramirez.com
|
||||||
|
* MIT Licensed.
|
||||||
|
*/
|
||||||
|
|
||||||
|
var config = {
|
||||||
|
port: 8080,
|
||||||
|
ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"],
|
||||||
|
|
||||||
|
language: "en",
|
||||||
|
timeFormat: 12,
|
||||||
|
units: "metric",
|
||||||
|
electronOptions: {
|
||||||
|
webPreferences: {
|
||||||
|
nodeIntegration: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
modules: [
|
||||||
|
{
|
||||||
|
module: "clock",
|
||||||
|
position: "middle_center",
|
||||||
|
config: {
|
||||||
|
displaySeconds: false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
|
||||||
|
/*************** DO NOT EDIT THE LINE BELOW ***************/
|
||||||
|
if (typeof module !== "undefined") {module.exports = config;}
|
@ -98,4 +98,26 @@ describe("Clock module", function () {
|
|||||||
.getText(".clock .time").should.eventually.match(timeRegex);
|
.getText(".clock .time").should.eventually.match(timeRegex);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe("with displaySeconds config disabled", function() {
|
||||||
|
before(function() {
|
||||||
|
// Set config sample for use in test
|
||||||
|
process.env.MM_CONFIG_FILE = "tests/configs/modules/clock/clock_displaySeconds_false.js";
|
||||||
|
});
|
||||||
|
|
||||||
|
beforeEach(function (done) {
|
||||||
|
app.start().then(function() { done(); } );
|
||||||
|
});
|
||||||
|
|
||||||
|
afterEach(function (done) {
|
||||||
|
app.stop().then(function() { done(); });
|
||||||
|
});
|
||||||
|
|
||||||
|
it("shows 12hr time without seconds am/pm", function() {
|
||||||
|
const timeRegex = /^(?:1[0-2]|[1-9]):[0-5]\d[ap]m$/;
|
||||||
|
return app.client.waitUntilWindowLoaded()
|
||||||
|
.getText(".clock .time").should.eventually.match(timeRegex);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user