mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-08-21 12:55:22 +00:00
Hello and thank you for wanting to contribute to the MagicMirror² project **Please make sure that you have followed these 4 rules before submitting your Pull Request:** > 1. Base your pull requests against the `develop` branch. > 2. Include these infos in the description: > > - Does the pull request solve a **related** issue? > - If so, can you reference the issue like this `Fixes #<issue_number>`? > - What does the pull request accomplish? Use a list if needed. > - If it includes major visual changes please add screenshots. > > 3. Please run `npm run lint:prettier` before submitting so that > style issues are fixed. > 4. Don't forget to add an entry about your changes to > the CHANGELOG.md file. **Note**: Sometimes the development moves very fast. It is highly recommended that you update your branch of `develop` before creating a pull request to send us your changes. This makes everyone's lives easier (including yours) and helps us out on the development team. Thanks again and have a nice day!
This commit is contained in:
36
tests/configs/modules/calendar/exdate.js
Normal file
36
tests/configs/modules/calendar/exdate.js
Normal file
@@ -0,0 +1,36 @@
|
||||
/* MagicMirror² Test calendar exdate
|
||||
*
|
||||
* By jkriegshauser
|
||||
* MIT Licensed.
|
||||
*
|
||||
* NOTE: calendar_test_exdate.ics has exdate entries for the next 20 years, but without some
|
||||
* way to set a debug date for tests, this test may become flaky on specific days (i.e. could
|
||||
* not test easily on leap-years, the BYDAY specified in exdate, etc.) or when the 20 years
|
||||
* elapses if this project is still in active development ;)
|
||||
* See issue #3250
|
||||
*/
|
||||
let config = {
|
||||
timeFormat: 12,
|
||||
|
||||
modules: [
|
||||
{
|
||||
module: "calendar",
|
||||
position: "bottom_bar",
|
||||
config: {
|
||||
maximumEntries: 100,
|
||||
calendars: [
|
||||
{
|
||||
maximumEntries: 100,
|
||||
maximumNumberOfDays: 364,
|
||||
url: "http://localhost:8080/tests/mocks/calendar_test_exdate.ics"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
/*************** DO NOT EDIT THE LINE BELOW ***************/
|
||||
if (typeof module !== "undefined") {
|
||||
module.exports = config;
|
||||
}
|
@@ -84,6 +84,17 @@ describe("Calendar module", () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("exdate check", () => {
|
||||
beforeAll(async () => {
|
||||
await helpers.startApplication("tests/configs/modules/calendar/exdate.js");
|
||||
await helpers.getDocument();
|
||||
});
|
||||
|
||||
it("should show the recurring event 51 times (excluded once) in a 364-day (inclusive) period", async () => {
|
||||
await testElementLength(".calendar .event", 51);
|
||||
});
|
||||
});
|
||||
|
||||
describe("Events from multiple calendars", () => {
|
||||
beforeAll(async () => {
|
||||
await helpers.startApplication("tests/configs/modules/calendar/show-duplicates-in-calendar.js");
|
||||
|
34
tests/mocks/calendar_test_exdate.ics
Normal file
34
tests/mocks/calendar_test_exdate.ics
Normal file
@@ -0,0 +1,34 @@
|
||||
BEGIN:VEVENT
|
||||
DTSTART;TZID=UTC:20231025T181000
|
||||
DTEND;TZID=UTC:20231025T195000
|
||||
RRULE:FREQ=WEEKLY;BYDAY=WE
|
||||
EXDATE;TZID=UTC:20231101T181000
|
||||
EXDATE;TZID=UTC:20241030T181000
|
||||
EXDATE;TZID=UTC:20251029T181000
|
||||
EXDATE;TZID=UTC:20261028T181000
|
||||
EXDATE;TZID=UTC:20271027T181000
|
||||
EXDATE;TZID=UTC:20281025T181000
|
||||
EXDATE;TZID=UTC:20291024T181000
|
||||
EXDATE;TZID=UTC:20301023T181000
|
||||
EXDATE;TZID=UTC:20311022T181000
|
||||
EXDATE;TZID=UTC:20321020T181000
|
||||
EXDATE;TZID=UTC:20331019T181000
|
||||
EXDATE;TZID=UTC:20341018T181000
|
||||
EXDATE;TZID=UTC:20351017T181000
|
||||
EXDATE;TZID=UTC:20361015T181000
|
||||
EXDATE;TZID=UTC:20371014T181000
|
||||
EXDATE;TZID=UTC:20381013T181000
|
||||
EXDATE;TZID=UTC:20391012T181000
|
||||
EXDATE;TZID=UTC:20401010T181000
|
||||
EXDATE;TZID=UTC:20411009T181000
|
||||
EXDATE;TZID=UTC:20421008T181000
|
||||
EXDATE;TZID=UTC:20431007T181000
|
||||
DTSTAMP:20231025T233434Z
|
||||
UID:sdflbkasuhdb5fkauglkb@google.com
|
||||
CREATED:20230306T193128Z
|
||||
LAST-MODIFIED:20231024T222515Z
|
||||
SEQUENCE:0
|
||||
STATUS:CONFIRMED
|
||||
SUMMARY:My Event
|
||||
TRANSP:OPAQUE
|
||||
END:VEVENT
|
Reference in New Issue
Block a user