diff --git a/tests/configs/modules/calendar/fail-basic-auth.js b/tests/configs/modules/calendar/fail-basic-auth.js new file mode 100644 index 00000000..ad22046a --- /dev/null +++ b/tests/configs/modules/calendar/fail-basic-auth.js @@ -0,0 +1,44 @@ +/* Magic Mirror Test calendar calendar + * + * This configuration is a wrong authentication + * + * 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: "calendar", + position: "bottom_bar", + config: { + calendars: [ + { + maximumNumberOfDays: 10000, + url: "http://localhost:8020/tests/configs/data/calendar_test.ics", + auth: { + user: "MagicMirror", + pass: "StairwayToHeaven", + method: "basic" + } + } + ] + } + } + ] +}; + +/*************** DO NOT EDIT THE LINE BELOW ***************/ +if (typeof module !== "undefined") {module.exports = config;} diff --git a/tests/e2e/modules/calendar_spec.js b/tests/e2e/modules/calendar_spec.js index 21939f06..c701ed3c 100644 --- a/tests/e2e/modules/calendar_spec.js +++ b/tests/e2e/modules/calendar_spec.js @@ -65,6 +65,17 @@ describe("Calendar module", function () { }); }); + describe("Fail Basic auth", function() { + before(function() { + serverBasicAuth.listen(8020); + // Set config sample for use in test + process.env.MM_CONFIG_FILE = "tests/configs/modules/calendar/fail-basic-auth.js"; + }); + + it("Should return No upcoming events", function () { + return app.client.waitUntilTextExists(".calendar", "No upcoming events.", 10000); + }); + }); });