diff options
| author | Craig Jennings <c@cjennings.net> | 2026-06-23 23:40:27 -0400 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-06-23 23:40:27 -0400 |
| commit | 8869a083c3cc28c20efa63e8932347329b2865f4 (patch) | |
| tree | 8959775eb2cae28a3418542ab8e2fc235fe465f2 /tests/test-pearl-favorites.el | |
| parent | 92ae9d8b56a9fabadf6ea8beb2163655c7a8ffb8 (diff) | |
| download | pearl-8869a083c3cc28c20efa63e8932347329b2865f4.tar.gz pearl-8869a083c3cc28c20efa63e8932347329b2865f4.zip | |
feat(sources): single-issue source (favorites + open-issue-by-id)
I wired the issue kind into the same pipeline every other source uses, so a favorited issue renders in the buffer as its own subtree instead of the v1 browser punt. The new pearl-open-issue-by-id command does the same for an issue you type by identifier or id. It's handy when someone hands you ENG-123 and you'd rather read it in Pearl than a browser.
Linear's issue(id:) accepts both the UUID and the human identifier, so there's no resolution step. I fetch by whatever was given and build the :type issue source from the returned node, so the stored id and identifier stay authoritative. Refresh re-fetches the one issue and merges by LINEAR-ID like the filter and view sources.
Tests cover the source constructor, the header round-trip, and the fetch/render and command paths across Normal, Boundary, and Error.
Diffstat (limited to 'tests/test-pearl-favorites.el')
| -rw-r--r-- | tests/test-pearl-favorites.el | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/test-pearl-favorites.el b/tests/test-pearl-favorites.el index 3f1452f..cb229b6 100644 --- a/tests/test-pearl-favorites.el +++ b/tests/test-pearl-favorites.el @@ -160,13 +160,17 @@ string -- the favorites query selects customView.name for exactly this." (let ((s (pearl--favorite->source (test-pearl-fav--norm 'user "user-1" "Vrezh")))) (should (equal '(:assignee-id "user-1" :open t) (plist-get s :filter))))) -(ert-deftest test-pearl-favorite->source-issue-is-browser () - "Issue favorites are browser-only in v1 (no source)." +(ert-deftest test-pearl-favorite->source-issue-renders-in-buffer () + "An issue favorite resolves to a `:type issue' source, rendered in-buffer +\(not the v1 browser punt). The identifier becomes the source name." (let ((s (pearl--favorite->source (append (test-pearl-fav--norm 'issue "iss-1" "Some bug" "https://linear.app/x/issue/ENG-1") (list :identifier "ENG-1"))))) - (should (plist-get s :browser)) - (should (string= "https://linear.app/x/issue/ENG-1" (plist-get s :url))))) + (should-not (plist-get s :browser)) + (should (eq 'issue (plist-get s :type))) + (should (string= "iss-1" (plist-get s :id))) + (should (string= "ENG-1" (plist-get s :identifier))) + (should (string= "ENG-1" (plist-get s :name))))) (ert-deftest test-pearl-favorite->source-other-is-browser () "An unknown-kind favorite is browser-only." |
