Merge pull request #725 from roramirez/compliments-anytime

Test anytime compliments module.
This commit is contained in:
Michael Teeuw 2017-02-20 19:54:33 +01:00 committed by GitHub
commit 6be5fac953
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: [],
afternoon: [],
evening: [],
anytime: ["Anytime here"]
}
}
}
]
};
/*************** DO NOT EDIT THE LINE BELOW ***************/
if (typeof module !== "undefined") {module.exports = config;}

View File

@ -56,4 +56,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 because if configure empty parts of day compliments and set anytime compliments", function () {
return app.client.waitUntilWindowLoaded()
.getText(".compliments").then(function (text) {
expect(text).to.be.oneOf(["Anytime here"]);
})
});
});
});