mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 11:50:00 +00:00
Add test case
This commit is contained in:
parent
2b6a9fc5bb
commit
3895c18466
48
tests/configs/modules/weather/currentweather_compliments.js
Normal file
48
tests/configs/modules/weather/currentweather_compliments.js
Normal 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;
|
||||
}
|
@ -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";
|
||||
|
Loading…
x
Reference in New Issue
Block a user