calendar: add test for recurring event EXDATE exclusion #74

Merged
JakeHillion merged 1 commits from feature/lnrsoorupwtz into main 2026-05-13 17:47:18 +01:00
+44
View File
@@ -847,6 +847,50 @@ async fn test_multi_event_calendar() {
assert_eq!(event_lines.len(), 3, "Expected 3 events, got: {result}");
}
#[tokio::test]
async fn test_recurring_event_exdate_excludes_occurrence() {
let fixture = RadicaleFixture::start().await;
fixture.create_calendar("personal").await;
fixture
.put_event(
"personal",
"weekly-exdate.ics",
"BEGIN:VCALENDAR\r\n\
VERSION:2.0\r\n\
PRODID:-//Test//Test//EN\r\n\
BEGIN:VEVENT\r\n\
UID:weekly-exdate@example.com\r\n\
DTSTART:20240315T100000Z\r\n\
DTEND:20240315T110000Z\r\n\
RRULE:FREQ=WEEKLY;BYDAY=MO,WE,FR\r\n\
EXDATE:20240320T100000Z\r\n\
SUMMARY:Standup Meeting\r\n\
END:VEVENT\r\n\
END:VCALENDAR",
)
.await;
let tools = fixture.calendar_tools("personal").await;
let result = tools
.list_events(&serde_json::json!({
"start_date": "2024-03-18",
"end_date": "2024-03-20",
"calendar_name": "personal"
}))
.await
.expect("list_events failed");
insta::assert_snapshot!(redact_for_snapshot(&result), @"
Found 2 events:
[/testuser/CALENDAR/weekly-exdate.ics#2024-03-18T10:00:00+00:00] Standup Meeting [recurring] — [Monday 18 March 2024 10:00 UTC] - [Monday 18 March 2024 11:00 UTC]
[/testuser/CALENDAR/weekly-exdate.ics#2024-03-20T10:00:00+00:00] Standup Meeting [recurring] — [Wednesday 20 March 2024 10:00 UTC] - [Wednesday 20 March 2024 11:00 UTC]
Use calendar_get_event with an event ID for full details.
");
}
#[tokio::test]
async fn test_empty_calendar() {
let fixture = RadicaleFixture::start().await;