aboutsummaryrefslogtreecommitdiff
path: root/tests/test-pearl-accounts.el
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test-pearl-accounts.el')
-rw-r--r--tests/test-pearl-accounts.el9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/test-pearl-accounts.el b/tests/test-pearl-accounts.el
index 4de9c2f..82f5e56 100644
--- a/tests/test-pearl-accounts.el
+++ b/tests/test-pearl-accounts.el
@@ -85,6 +85,15 @@
'(:auth-source :host "api.linear.app" :user "work") "work")
:type 'user-error)))
+(ert-deftest test-pearl-resolve-api-key-source-auth-miss-hints-at-cache ()
+ "An auth-source miss hints at the negative cache, so a freshly added key is
+recoverable via clear-cache rather than reading as permanently missing."
+ (cl-letf (((symbol-function 'auth-source-search) (lambda (&rest _) nil)))
+ (let ((err (should-error (pearl--resolve-api-key-source
+ '(:auth-source :host "api.linear.app" :user "work") "work")
+ :type 'user-error)))
+ (should (string-match-p "clear-cache" (error-message-string err))))))
+
;;; pearl--resolve-account
(ert-deftest test-pearl-resolve-account-returns-full-context ()