mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-07-04 06:46:05 +00:00
Merge pull request #733 from roramirez/second-test-anytime
Second test case anytime feature module compliments
This commit is contained in:
commit
d6394402b8
@ -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;}
|
@ -6,21 +6,23 @@ const expect = chai.expect;
|
|||||||
describe("Compliments module", function () {
|
describe("Compliments module", function () {
|
||||||
this.timeout(20000);
|
this.timeout(20000);
|
||||||
|
|
||||||
|
|
||||||
|
beforeEach(function (done) {
|
||||||
|
app.start().then(function() { done(); } );
|
||||||
|
});
|
||||||
|
|
||||||
|
afterEach(function (done) {
|
||||||
|
app.stop().then(function() { done(); });
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
describe("parts of days", function() {
|
describe("parts of days", function() {
|
||||||
|
|
||||||
before(function() {
|
before(function() {
|
||||||
// Set config sample for use in test
|
// Set config sample for use in test
|
||||||
process.env.MM_CONFIG_FILE = "tests/configs/modules/compliments/compliments_parts_day.js";
|
process.env.MM_CONFIG_FILE = "tests/configs/modules/compliments/compliments_parts_day.js";
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(function (done) {
|
|
||||||
app.start().then(function() { done(); } );
|
|
||||||
});
|
|
||||||
|
|
||||||
afterEach(function (done) {
|
|
||||||
app.stop().then(function() { done(); });
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
it("if Morning compliments for that part of day", function () {
|
it("if Morning compliments for that part of day", function () {
|
||||||
var hour = new Date().getHours();
|
var hour = new Date().getHours();
|
||||||
if (hour >= 3 && hour < 12) {
|
if (hour >= 3 && hour < 12) {
|
||||||
@ -57,26 +59,37 @@ describe("Compliments module", function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
describe("Tests anytime for compliments", function() {
|
describe("Feature anytime in compliments module", function() {
|
||||||
before(function() {
|
|
||||||
// Set config sample for use in test
|
describe("Set anytime and empty compliments for morning, evening and afternoon ", function() {
|
||||||
process.env.MM_CONFIG_FILE = "tests/configs/modules/compliments/compliments_anytime.js";
|
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) {
|
||||||
|
expect(text).to.be.oneOf(["Anytime here"]);
|
||||||
|
})
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(function (done) {
|
describe("Only anytime present in configuration compliments", function() {
|
||||||
app.start().then(function() { done(); } );
|
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"]);
|
||||||
|
})
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
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"]);
|
|
||||||
})
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user