Add test case

This commit is contained in:
veeck 2021-01-17 14:50:48 +01:00
parent 2b6a9fc5bb
commit 3895c18466
2 changed files with 61 additions and 0 deletions

View File

@ -0,0 +1,48 @@
/* Magic Mirror Test config current weather compliments
*
* By rejas https://github.com/rejas
*
* MIT Licensed.
*/
let config = {
port: 8080,
ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"],
language: "en",
timeFormat: 24,
units: "metric",
electronOptions: {
fullscreen: false,
webPreferences: {
nodeIntegration: true
}
},
modules: [
{
module: "compliments",
position: "top_bar",
config: {
compliments: {
snow: ["snow"]
},
updateInterval: 4000
}
},
{
module: "weather",
position: "bottom_bar",
config: {
location: "Munich",
apiKey: "fake key",
initialLoadDelay: 3000
}
}
]
};
/*************** DO NOT EDIT THE LINE BELOW ***************/
if (typeof module !== "undefined") {
module.exports = config;
}

View File

@ -87,6 +87,19 @@ describe("Weather module", function () {
});
});
describe("Compliments Integration", function () {
before(function () {
process.env.MM_CONFIG_FILE = "tests/configs/modules/weather/currentweather_compliments.js";
});
it("should render a compliment based on the current weather", async function () {
const weather = generateWeather();
await setup({ template, data: weather });
return app.client.waitUntilTextExists(".compliments .module-content span", "snow", 10000);
});
});
describe("Configuration Options", function () {
before(function () {
process.env.MM_CONFIG_FILE = "tests/configs/modules/weather/currentweather_options.js";