aboutsummaryrefslogtreecommitdiff
path: root/tests/test-pearl-assignee-labels.el
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test-pearl-assignee-labels.el')
-rw-r--r--tests/test-pearl-assignee-labels.el13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/test-pearl-assignee-labels.el b/tests/test-pearl-assignee-labels.el
index e7be619..09d0fbd 100644
--- a/tests/test-pearl-assignee-labels.el
+++ b/tests/test-pearl-assignee-labels.el
@@ -55,6 +55,19 @@
(should (string= "Craig" (org-entry-get nil "LINEAR-ASSIGNEE-NAME")))
(should (string= "u9" (org-entry-get nil "LINEAR-ASSIGNEE-ID")))))))
+(ert-deftest test-pearl-edit-assignee-updates-heading-tag-preserving-labels ()
+ "edit-assignee refreshes the @-assignee tag on the heading (so it isn't stale
+until the next fetch) while leaving the label tags in place."
+ (test-pearl--in-org
+ "*** TODO Title :@someone:bug:\n:PROPERTIES:\n:LINEAR-ID: a\n:LINEAR-TEAM-ID: team-1\n:LINEAR-ASSIGNEE-ID: old\n:LINEAR-ASSIGNEE-NAME: Someone\n:END:\n"
+ (cl-letf (((symbol-function 'pearl--resolve-team-id)
+ (lambda (_kind _name _team &optional _force) "u9")))
+ (pearl-edit-assignee "Eric")
+ (goto-char (point-min))
+ (should (re-search-forward "^\\*\\*\\* TODO Title[ \t]+:@eric:bug:$" nil t))
+ (should-not (save-excursion (goto-char (point-min))
+ (re-search-forward ":@someone:" nil t))))))
+
(ert-deftest test-pearl-edit-assignee-unresolvable-errors ()
"An unresolvable assignee name signals a user error and writes nothing."
(test-pearl--in-org