diff --git a/tests/configs/data/calendar_test_recurring.ics b/tests/configs/data/calendar_test_recurring.ics new file mode 100644 index 00000000..5d063fa1 --- /dev/null +++ b/tests/configs/data/calendar_test_recurring.ics @@ -0,0 +1,37 @@ +BEGIN:VCALENDAR +PRODID:-//Google Inc//Google Calendar 70.9054//EN +VERSION:2.0 +CALSCALE:GREGORIAN +METHOD:PUBLISH +X-WR-CALNAME:xxx@gmail.com +X-WR-TIMEZONE:Europe/Zurich +BEGIN:VTIMEZONE +TZID:Etc/UTC +X-LIC-LOCATION:Etc/UTC +BEGIN:STANDARD +TZOFFSETFROM:+0000 +TZOFFSETTO:+0000 +TZNAME:GMT +DTSTART:19700101T00000--äüüßßß-0 +END:STANDARD +END:VTIMEZONE +BEGIN:VEVENT +DTSTART;VALUE=DATE:20210325 +DTEND;VALUE=DATE:20210326 +RRULE:FREQ=YEARLY;WKST=MO;INTERVAL=1;BYMONTHDAY=25 +DTSTAMP:20210421T154106Z +UID:zzz@google.com +REATED:20200831T200244Z +DESCRIPTION: +LAST-MODIFIED:20200831T200244Z +LOCATION: +SEQUENCE:0 +STATUS:CONFIRMED +SUMMARY:Birthday +TRANSP:OPAQUE +BEGIN:VALARM +ACTION:DISPLAY +DESCRIPTION:This is an event reminder +TRIGGER:-P0DT7H0M0S +END:VALARM +END:VEVENT diff --git a/tests/configs/modules/calendar/recurring.js b/tests/configs/modules/calendar/recurring.js new file mode 100644 index 00000000..62417200 --- /dev/null +++ b/tests/configs/modules/calendar/recurring.js @@ -0,0 +1,43 @@ +/* Magic Mirror Test config custom calendar + * + * By Rejas + * MIT Licensed. + */ +let config = { + port: 8080, + ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], + + language: "en", + timeFormat: 12, + units: "metric", + electronOptions: { + webPreferences: { + nodeIntegration: true, + enableRemoteModule: true + } + }, + + modules: [ + { + module: "calendar", + position: "bottom_bar", + config: { + calendars: [ + { + maximumEntries: 4, + maximumNumberOfDays: 10000, + symbol: "birthday-cake", + fullDaySymbol: "calendar-day", + recurringSymbol: "undo", + url: "http://localhost:8080/tests/configs/data/calendar_test_recurring.ics" + } + ] + } + } + ] +}; + +/*************** 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 34cc0164..10357e5b 100644 --- a/tests/e2e/modules/calendar_spec.js +++ b/tests/e2e/modules/calendar_spec.js @@ -76,6 +76,20 @@ describe("Calendar module", function () { }); }); + describe("Recurring event", function () { + before(function () { + // Set config sample for use in test + process.env.MM_CONFIG_FILE = "tests/configs/modules/calendar/recurring.js"; + }); + + it("should something correct", async () => { + // TODO add real test case + await app.client.waitUntilTextExists(".calendar", "TestEvent", 10000); + const events = await app.client.$$(".calendar .event"); + return expect(events.length).equals(4); + }); + }); + describe("Changed port", function () { before(function () { serverBasicAuth.listen(8010);