;;; 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
")))) (ert-deftest test-calendar-sync--strip-html-boundary-multiple-br () "Test multiple consecutive
nested text