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--strip-html.el | 99 +++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 tests/test-calendar-sync--strip-html.el (limited to 'tests/test-calendar-sync--strip-html.el') diff --git a/tests/test-calendar-sync--strip-html.el b/tests/test-calendar-sync--strip-html.el new file mode 100644 index 00000000..fda2bbc5 --- /dev/null +++ b/tests/test-calendar-sync--strip-html.el @@ -0,0 +1,99 @@ +;;; test-calendar-sync--strip-html.el --- Tests for HTML stripping -*- lexical-binding: t; -*- + +;;; Commentary: +;; Unit tests for calendar-sync--strip-html function. +;; Converts
/
to newline, strips all other tags, decodes HTML entities. +;; Covers Normal, Boundary, and Error cases. + +;;; Code: + +(require 'ert) +(require 'testutil-calendar-sync) +(require 'calendar-sync) + +;;; Normal Cases + +(ert-deftest test-calendar-sync--strip-html-normal-br-to-newline () + "Test
converted to newline." + (should (string= "line1\nline2" + (calendar-sync--strip-html "line1
line2")))) + +(ert-deftest test-calendar-sync--strip-html-normal-br-self-closing () + "Test
converted to newline." + (should (string= "line1\nline2" + (calendar-sync--strip-html "line1
line2")))) + +(ert-deftest test-calendar-sync--strip-html-normal-br-space-self-closing () + "Test
converted to newline." + (should (string= "line1\nline2" + (calendar-sync--strip-html "line1
line2")))) + +(ert-deftest test-calendar-sync--strip-html-normal-strip-p-tags () + "Test

and

tags are stripped." + (should (string= "paragraph text" + (calendar-sync--strip-html "

paragraph text

")))) + +(ert-deftest test-calendar-sync--strip-html-normal-strip-bold () + "Test and tags are stripped." + (should (string= "bold text" + (calendar-sync--strip-html "bold text")))) + +(ert-deftest test-calendar-sync--strip-html-normal-combined-tags () + "Test mixed tags are handled." + (should (string= "Hello\nWorld" + (calendar-sync--strip-html "

Hello


World")))) + +(ert-deftest test-calendar-sync--strip-html-normal-entity-amp () + "Test & decoded to &." + (should (string= "A & B" + (calendar-sync--strip-html "A & B")))) + +(ert-deftest test-calendar-sync--strip-html-normal-entity-lt () + "Test < decoded to <." + (should (string= "a < b" + (calendar-sync--strip-html "a < b")))) + +(ert-deftest test-calendar-sync--strip-html-normal-entity-gt () + "Test > decoded to >." + (should (string= "a > b" + (calendar-sync--strip-html "a > b")))) + +(ert-deftest test-calendar-sync--strip-html-normal-entity-quot () + "Test " decoded to double quote." + (should (string= "say \"hello\"" + (calendar-sync--strip-html "say "hello"")))) + +;;; Boundary Cases + +(ert-deftest test-calendar-sync--strip-html-boundary-empty-string () + "Test empty string returns empty string." + (should (string= "" (calendar-sync--strip-html "")))) + +(ert-deftest test-calendar-sync--strip-html-boundary-no-html () + "Test plain text passes through unchanged." + (should (string= "just plain text" + (calendar-sync--strip-html "just plain text")))) + +(ert-deftest test-calendar-sync--strip-html-boundary-only-tags () + "Test string of only tags returns empty." + (should (string= "" + (calendar-sync--strip-html "

")))) + +(ert-deftest test-calendar-sync--strip-html-boundary-multiple-br () + "Test multiple consecutive
collapse." + (should (string-match-p "^line1\n+line2$" + (calendar-sync--strip-html "line1


line2")))) + +(ert-deftest test-calendar-sync--strip-html-boundary-nested-tags () + "Test nested tags are stripped correctly." + (should (string= "nested text" + (calendar-sync--strip-html "

nested text

")))) + +;;; Error Cases + +(ert-deftest test-calendar-sync--strip-html-error-nil-input () + "Test nil input returns nil." + (should (null (calendar-sync--strip-html nil)))) + +(provide 'test-calendar-sync--strip-html) +;;; test-calendar-sync--strip-html.el ends here -- cgit v1.2.3