diff --git a/CHANGELOG.md b/CHANGELOG.md index 5735a60a..25a28f61 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ Special thanks to the following contributors: @B1gG, @codac, @ezeholz, @khassel, - Added first test for Alert module. - Added support for `dateFormat` when not using `timeFormat: "absolute"` - Added custom-properties in css of core and modules for improved styling experience, see `custom.css.sample` file +- Added test case for recurring calendar events ### Updated diff --git a/tests/configs/data/calendar_test_recurring.ics b/tests/configs/data/calendar_test_recurring.ics new file mode 100644 index 00000000..635497da --- /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 +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..371446a3 --- /dev/null +++ b/tests/configs/modules/calendar/recurring.js @@ -0,0 +1,40 @@ +/* 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: 6, + maximumNumberOfDays: 3650, + 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..a5cbe55a 100644 --- a/tests/e2e/modules/calendar_spec.js +++ b/tests/e2e/modules/calendar_spec.js @@ -76,6 +76,19 @@ 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 show the recurring birthday event 6 times", async () => { + await app.client.waitUntilTextExists(".calendar", "Mar 25th", 10000); + const events = await app.client.$$(".calendar .event"); + return expect(events.length).equals(6); + }); + }); + describe("Changed port", function () { before(function () { serverBasicAuth.listen(8010);