summaryrefslogtreecommitdiff
path: root/tests/test-calendar-sync--extract-meeting-url.el
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-02-05 15:13:57 -0600
committerCraig Jennings <c@cjennings.net>2026-02-05 15:13:57 -0600
commitb7cb1c51e5663419344d8b55766635801f3ee4c8 (patch)
treea13d903c1d7d82d8b49fe7edbd5f9b7652592c23 /tests/test-calendar-sync--extract-meeting-url.el
parent12f36cb887c3e84741bc2f3d6afd9e71c6ffddd7 (diff)
feat(calendar-sync): add event details — attendees, organizer, status, URL
Add ICS text unescaping (RFC 5545), HTML stripping, and new fields (attendees/status, organizer, meeting URL) to calendar-sync.el. event-to-org now outputs org property drawers. 88 new tests across 10 test files, 146/146 pass. Also fix pre-existing test require order and keymap guard issues.
Diffstat (limited to 'tests/test-calendar-sync--extract-meeting-url.el')
-rw-r--r--tests/test-calendar-sync--extract-meeting-url.el54
1 files changed, 54 insertions, 0 deletions
diff --git a/tests/test-calendar-sync--extract-meeting-url.el b/tests/test-calendar-sync--extract-meeting-url.el
new file mode 100644
index 00000000..2f677991
--- /dev/null
+++ b/tests/test-calendar-sync--extract-meeting-url.el
@@ -0,0 +1,54 @@
+;;; test-calendar-sync--extract-meeting-url.el --- Tests for meeting URL extraction -*- lexical-binding: t; -*-
+
+;;; Commentary:
+;; Unit tests for calendar-sync--extract-meeting-url function.
+;; Extracts URL from X-GOOGLE-CONFERENCE (preferred) or URL property.
+;; Covers Normal, Boundary, and Error cases.
+
+;;; Code:
+
+(require 'ert)
+(require 'testutil-calendar-sync)
+(require 'calendar-sync)
+
+;;; Normal Cases
+
+(ert-deftest test-calendar-sync--extract-meeting-url-normal-google-conference ()
+ "Test extracting X-GOOGLE-CONFERENCE URL."
+ (let ((event "BEGIN:VEVENT\nX-GOOGLE-CONFERENCE:https://meet.google.com/abc-defg-hij\nSUMMARY:Test\nEND:VEVENT"))
+ (should (string= "https://meet.google.com/abc-defg-hij"
+ (calendar-sync--extract-meeting-url event)))))
+
+(ert-deftest test-calendar-sync--extract-meeting-url-normal-url-property ()
+ "Test extracting URL property."
+ (let ((event "BEGIN:VEVENT\nURL:https://zoom.us/j/123456\nSUMMARY:Test\nEND:VEVENT"))
+ (should (string= "https://zoom.us/j/123456"
+ (calendar-sync--extract-meeting-url event)))))
+
+;;; Boundary Cases
+
+(ert-deftest test-calendar-sync--extract-meeting-url-boundary-both-present ()
+ "Test X-GOOGLE-CONFERENCE is preferred when both present."
+ (let ((event "BEGIN:VEVENT\nURL:https://zoom.us/j/123456\nX-GOOGLE-CONFERENCE:https://meet.google.com/abc\nSUMMARY:Test\nEND:VEVENT"))
+ (should (string= "https://meet.google.com/abc"
+ (calendar-sync--extract-meeting-url event)))))
+
+(ert-deftest test-calendar-sync--extract-meeting-url-boundary-neither-present ()
+ "Test returns nil when neither URL property exists."
+ (let ((event "BEGIN:VEVENT\nSUMMARY:Test\nDTSTART:20260210T140000Z\nEND:VEVENT"))
+ (should (null (calendar-sync--extract-meeting-url event)))))
+
+(ert-deftest test-calendar-sync--extract-meeting-url-boundary-url-with-params ()
+ "Test URL property with parameters."
+ (let ((event "BEGIN:VEVENT\nURL;VALUE=URI:https://teams.microsoft.com/l/meetup-join/abc\nSUMMARY:Test\nEND:VEVENT"))
+ (should (string-match-p "teams.microsoft.com"
+ (calendar-sync--extract-meeting-url event)))))
+
+;;; Error Cases
+
+(ert-deftest test-calendar-sync--extract-meeting-url-error-nil-event ()
+ "Test nil event returns nil."
+ (should (null (calendar-sync--extract-meeting-url nil))))
+
+(provide 'test-calendar-sync--extract-meeting-url)
+;;; test-calendar-sync--extract-meeting-url.el ends here