aboutsummaryrefslogtreecommitdiff
path: root/tests/test-pearl-labels.el
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test-pearl-labels.el')
-rw-r--r--tests/test-pearl-labels.el14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/test-pearl-labels.el b/tests/test-pearl-labels.el
index 94211b1..febb906 100644
--- a/tests/test-pearl-labels.el
+++ b/tests/test-pearl-labels.el
@@ -95,6 +95,20 @@ field -- which is the full email for teammates who never set a display name."
"With no displayName, the tag slugs the name."
(should (string= "@eric_bell" (pearl--assignee-tag '(:name "Eric Bell")))))
+(ert-deftest test-pearl-assignee-tag-short-keeps-first-segment ()
+ "With `pearl-assignee-tag-short' on, only the first name (before the first dot
+or space) is kept, so a firstname.lastname handle shortens to just the first."
+ (let ((pearl-assignee-tag-short t))
+ (should (string= "@vrezh" (pearl--assignee-tag '(:display-name "vrezh.mikayelyan"))))
+ (should (string= "@eric" (pearl--assignee-tag '(:name "Eric Bell"))))
+ ;; A single-token handle is unchanged.
+ (should (string= "@nerses" (pearl--assignee-tag '(:display-name "nerses"))))))
+
+(ert-deftest test-pearl-assignee-tag-short-off-keeps-full-handle ()
+ "Off by default: the full slugified handle is kept."
+ (should (string= "@vrezh_mikayelyan"
+ (pearl--assignee-tag '(:display-name "vrezh.mikayelyan")))))
+
(ert-deftest test-pearl-normalize-user-captures-display-name ()
"The normalized user carries Linear's displayName so the @-tag can use the
short handle while the drawer keeps the fuller name."