diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test-pearl-comment-editing.el | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/test-pearl-comment-editing.el b/tests/test-pearl-comment-editing.el index 29a5236..b8b4af4 100644 --- a/tests/test-pearl-comment-editing.el +++ b/tests/test-pearl-comment-editing.el @@ -257,6 +257,30 @@ (should (eq 'pearl-editable-comment (face-on "^\\*\\*\\*\\*\\* Me"))) (should (eq 'pearl-readonly-comment (face-on "^\\*\\*\\*\\*\\* Them")))))) +(ert-deftest test-pearl-highlight-readonly-comment-dims-its-body () + "A read-only comment's body carries the grey overlay so the whole comment reads +as disabled; an editable comment's body is left uncovered so its text reads +normally (only its heading is colored)." + (test-pearl--in-org + (concat "*** TODO [#B] Title\n:PROPERTIES:\n:LINEAR-ID: a\n:END:\nBody.\n" + "**** Comments\n" + "***** Me — 2026-05-24T09:00:00.000Z\n" + ":PROPERTIES:\n:LINEAR-COMMENT-ID: c1\n:LINEAR-COMMENT-AUTHOR-ID: u-me\n:END:\nmine body\n" + "***** Them — 2026-05-24T10:00:00.000Z\n" + ":PROPERTIES:\n:LINEAR-COMMENT-ID: c2\n:LINEAR-COMMENT-AUTHOR-ID: u-other\n:END:\ntheirs body\n") + (pearl--apply-comment-highlights "u-me") + (cl-flet ((face-at (pat) + (goto-char (point-min)) + (re-search-forward pat) + (goto-char (match-beginning 0)) + (let ((ov (cl-find-if (lambda (o) (overlay-get o 'pearl-comment)) + (overlays-at (point))))) + (and ov (overlay-get ov 'face))))) + ;; the other person's comment body is dimmed with the read-only face + (should (eq 'pearl-readonly-comment (face-at "theirs body"))) + ;; my own comment body is left uncovered (its heading carries the green) + (should (null (face-at "mine body")))))) + (ert-deftest test-pearl-update-org-highlights-comments-on-bulk-render () "The bulk render colors comment headings, so a list-issues fetch shows editability without a follow-up refresh. Regression: highlighting ran only on |
