From b7cb1c51e5663419344d8b55766635801f3ee4c8 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Thu, 5 Feb 2026 15:13:57 -0600 Subject: =?UTF-8?q?feat(calendar-sync):=20add=20event=20details=20?= =?UTF-8?q?=E2=80=94=20attendees,=20organizer,=20status,=20URL?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- tests/test-calendar-sync--extract-meeting-url.el | 54 ++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 tests/test-calendar-sync--extract-meeting-url.el (limited to 'tests/test-calendar-sync--extract-meeting-url.el') 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 -- cgit v1.2.3