mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 11:50:00 +00:00
Add first test for alert module
This commit is contained in:
parent
f8769fcc2a
commit
79f5b938f5
34
tests/configs/modules/alert/default.js
Normal file
34
tests/configs/modules/alert/default.js
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
/* Magic Mirror Test config sample module alert
|
||||||
|
*
|
||||||
|
* By 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: {
|
||||||
|
webPreferences: {
|
||||||
|
nodeIntegration: true,
|
||||||
|
enableRemoteModule: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
modules: [
|
||||||
|
{
|
||||||
|
module: "alert",
|
||||||
|
config: {
|
||||||
|
display_time: 1000000,
|
||||||
|
welcome_message: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
|
||||||
|
/*************** DO NOT EDIT THE LINE BELOW ***************/
|
||||||
|
if (typeof module !== "undefined") {
|
||||||
|
module.exports = config;
|
||||||
|
}
|
37
tests/e2e/modules/alert_spec.js
Normal file
37
tests/e2e/modules/alert_spec.js
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
const helpers = require("../global-setup");
|
||||||
|
|
||||||
|
const describe = global.describe;
|
||||||
|
const it = global.it;
|
||||||
|
const beforeEach = global.beforeEach;
|
||||||
|
const afterEach = global.afterEach;
|
||||||
|
|
||||||
|
describe("Alert module", function () {
|
||||||
|
helpers.setupTimeout(this);
|
||||||
|
|
||||||
|
let app = null;
|
||||||
|
|
||||||
|
beforeEach(function () {
|
||||||
|
return helpers
|
||||||
|
.startApplication({
|
||||||
|
args: ["js/electron.js"]
|
||||||
|
})
|
||||||
|
.then(function (startedApp) {
|
||||||
|
app = startedApp;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
afterEach(function () {
|
||||||
|
return helpers.stopApplication(app);
|
||||||
|
});
|
||||||
|
|
||||||
|
describe("Default configuration", function () {
|
||||||
|
before(function () {
|
||||||
|
// Set config sample for use in test
|
||||||
|
process.env.MM_CONFIG_FILE = "tests/configs/modules/alert/default.js";
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should show the welcome message", function () {
|
||||||
|
return app.client.waitUntilTextExists(".ns-box .ns-box-inner .light.bright.small", "Welcome, start was successful!", 10000);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
Loading…
x
Reference in New Issue
Block a user