Second test case anytime feature module compliments

Suggested by @fewieden PL #725
This commit is contained in:
Rodrigo Ramírez Norambuena 2017-02-20 04:59:15 -03:00
parent 6be5fac953
commit 474695643f
2 changed files with 65 additions and 10 deletions

View File

@ -0,0 +1,35 @@
/* Magic Mirror Test config compliments with anytime type
*
* 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: "compliments",
position: "middle_center",
config: {
compliments: {
anytime: ["Anytime here"]
}
}
}
]
};
/*************** DO NOT EDIT THE LINE BELOW ***************/
if (typeof module !== "undefined") {module.exports = config;}

View File

@ -57,11 +57,7 @@ describe("Compliments module", function () {
});
describe("Tests anytime for compliments", function() {
before(function() {
// Set config sample for use in test
process.env.MM_CONFIG_FILE = "tests/configs/modules/compliments/compliments_anytime.js";
});
describe("Feature anytime in compliments module", function() {
beforeEach(function (done) {
app.start().then(function() { done(); } );
@ -71,6 +67,13 @@ describe("Compliments module", function () {
app.stop().then(function() { done(); });
});
describe("Set anytime and empty compliments for morning, evening and afternoon ", function() {
before(function() {
// Set config sample for use in test
process.env.MM_CONFIG_FILE = "tests/configs/modules/compliments/compliments_anytime.js";
});
it("Show anytime because if configure empty parts of day compliments and set anytime compliments", function () {
return app.client.waitUntilWindowLoaded()
.getText(".compliments").then(function (text) {
@ -79,4 +82,21 @@ describe("Compliments module", function () {
});
});
describe("Only anytime present in configuration compliments", function() {
before(function() {
// Set config sample for use in test
process.env.MM_CONFIG_FILE = "tests/configs/modules/compliments/compliments_only_anytime.js";
});
it("Show anytime compliments", function () {
return app.client.waitUntilWindowLoaded()
.getText(".compliments").then(function (text) {
expect(text).to.be.oneOf(["Anytime here"]);
})
});
});
});
});