diff --git a/tests/configs/modules/calendar/auth-default.js b/tests/configs/modules/calendar/auth-default.js new file mode 100644 index 00000000..3fee5015 --- /dev/null +++ b/tests/configs/modules/calendar/auth-default.js @@ -0,0 +1,41 @@ +/* Magic Mirror Test config default calendar with auth by default + * + * 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:8011/tests/configs/data/calendar_test.ics", + auth: { + user: "MagicMirror", + pass: "CallMeADog" + } + } + ] + } + } + ] +}; + +/*************** 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 3b4ac736..9bb68baa 100644 --- a/tests/e2e/modules/calendar_spec.js +++ b/tests/e2e/modules/calendar_spec.js @@ -41,5 +41,17 @@ describe("Calendar module", function () { }); + describe("Basic auth by default", function() { + before(function() { + serverBasicAuth.listen(8011); + // Set config sample for use in test + process.env.MM_CONFIG_FILE = "tests/configs/modules/calendar/auth-default.js"; + }); + + it("Should return TestEvents", function () { + return app.client.waitUntilTextExists(".calendar", "TestEvent", 10000); + }); + }); + });