Test anytime compliments module.

feature introduced 79c79146a5df730cb8e8eee1cc1008639a2c21c7
This commit is contained in:
Rodrigo Ramírez Norambuena 2017-02-18 23:38:39 -03:00
parent 11c0221f81
commit 1a296a8ca1
2 changed files with 61 additions and 0 deletions

View File

@ -0,0 +1,38 @@
/* 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: {
morning: ["Good Morning"],
afternoon: ["Good Afternoon"],
evening: ["Good Evening"],
anytime: ["Anytime here"]
}
}
}
]
};
/*************** DO NOT EDIT THE LINE BELOW ***************/
if (typeof module !== "undefined") {module.exports = config;}

View File

@ -75,4 +75,27 @@ 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";
});
beforeEach(function (done) {
app.start().then(function() { done(); } );
});
afterEach(function (done) {
app.stop().then(function() { done(); });
});
it("Show anytime or parts of day compliments", function () {
return app.client.waitUntilWindowLoaded()
.getText(".compliments").then(function (text) {
expect(text).to.be.oneOf(["Good Morning", "Good Evening", "Good Afternoon", "Anytime here"]);
})
});
});
});