diff options
| author | Craig Jennings <c@cjennings.net> | 2026-05-24 13:44:34 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-05-24 13:44:34 -0500 |
| commit | b081d62276378b3168c92c06153fd59db0589535 (patch) | |
| tree | 9be7f7d22e0c9b4a73432fe744c09bb456c671a9 /tests/testutil-fixtures.el | |
| download | pearl-b081d62276378b3168c92c06153fd59db0589535.tar.gz pearl-b081d62276378b3168c92c06153fd59db0589535.zip | |
feat: pearl — manage Linear issues from org-mode
Pearl fetches Linear issues into an org file and syncs edits back. It covers list / custom views / saved queries, per-issue and bulk rendering with comments inline, conflict-aware sync of descriptions, titles, and comments, field commands for priority / state / assignee / labels, and a transient dispatch menu. The render folds to a scannable outline and nests issues under a sortable parent.
Based on and inspired by Gael Blanchemain's linear-emacs.
Diffstat (limited to 'tests/testutil-fixtures.el')
| -rw-r--r-- | tests/testutil-fixtures.el | 105 |
1 files changed, 105 insertions, 0 deletions
diff --git a/tests/testutil-fixtures.el b/tests/testutil-fixtures.el new file mode 100644 index 0000000..5c55c7b --- /dev/null +++ b/tests/testutil-fixtures.el @@ -0,0 +1,105 @@ +;;; testutil-fixtures.el --- representative Linear API response fixtures -*- lexical-binding: t; -*- + +;; Copyright (C) 2026 Craig Jennings + +;; Author: Craig Jennings <c@cjennings.net> + +;;; Commentary: + +;; Small, representative response fixtures for the issue-query and +;; representation build. They cover an assignedIssues page, a top-level +;; issues(filter:) page, custom views, a custom view's issues, an issue with +;; comments, and an issue with null/missing optional fields. +;; +;; Shapes mirror what `json-read' returns from the live API: symbol-keyed +;; alists, `t' / `:json-false' for JSON booleans, and a missing key (rather +;; than an explicit value) for absent optional fields. Not a test file (no +;; `test-' prefix), so the suite runner ignores it; tests `require' it. +;; +;; These let normalization, query, and render tests run against stable +;; inputs without a live workspace. Captured from the documented schema +;; shapes; replace with real recorded responses once a live key is wired in. + +;;; Code: + +(defun testutil-linear-fixture-issue-full () + "A fully-populated issue node, every optional field present." + '((id . "uuid-1") + (identifier . "ENG-42") + (title . "Fix the thing") + (description . "Line one\nLine two") + (priority . 2) + (updatedAt . "2026-05-20T12:00:00.000Z") + (state . ((id . "state-1") (name . "In Progress") (type . "started") (color . "#fff"))) + (assignee . ((id . "user-1") (name . "Craig") (email . "c@example.com"))) + (team . ((id . "team-1") (key . "ENG") (name . "Engineering"))) + (project . ((id . "proj-1") (name . "Platform"))) + (cycle . ((id . "cycle-1") (number . 12) (name . "Cycle 12"))) + (labels . ((nodes . (((id . "lbl-1") (name . "bug")) + ((id . "lbl-2") (name . "backend")))))))) + +(defun testutil-linear-fixture-issue-null-fields () + "An issue with optional fields absent or null (project/labels/assignee/cycle). +Description is JSON null; labels is an empty connection." + '((id . "uuid-2") + (identifier . "ENG-7") + (title . "Bare issue") + (description) + (priority . 0) + (updatedAt . "2026-05-19T08:30:00.000Z") + (state . ((id . "state-2") (name . "Todo") (type . "unstarted"))) + (assignee) + (team . ((id . "team-1") (key . "ENG") (name . "Engineering"))) + (project) + (cycle) + (labels . ((nodes . ()))))) + +(defun testutil-linear-fixture-assigned-issues-page () + "A viewer.assignedIssues page: two issues, no next page." + `((data (viewer (assignedIssues + (nodes . (,(testutil-linear-fixture-issue-full) + ,(testutil-linear-fixture-issue-null-fields))) + (pageInfo (hasNextPage . :json-false) (endCursor . "cursor-1"))))))) + +(defun testutil-linear-fixture-issues-filter-page () + "A top-level issues(filter:) page: one issue, has a next page." + `((data (issues + (nodes . (,(testutil-linear-fixture-issue-full))) + (pageInfo (hasNextPage . t) (endCursor . "cursor-2")))))) + +(defun testutil-linear-fixture-custom-views () + "A customViews connection: one shared workspace view, one personal team view." + '((data (customViews + (nodes . (((id . "cv-1") (name . "My open work") (description . "Everything open assigned to me") + (shared . :json-false) (team) (icon . "Inbox") (color . "#aabbcc") + (owner . ((id . "user-1") (name . "Craig")))) + ((id . "cv-2") (name . "Eng in progress") (description) + (shared . t) (team . ((id . "team-1") (key . "ENG") (name . "Engineering"))) + (icon) (color) + (owner . ((id . "user-1") (name . "Craig")))))) + (pageInfo (hasNextPage . :json-false) (endCursor . "cv-cursor")))))) + +(defun testutil-linear-fixture-custom-view-issues () + "A customView(id).issues page: the view's filter resolved server-side." + `((data (customView + (id . "cv-1") + (name . "My open work") + (issues + (nodes . (,(testutil-linear-fixture-issue-full))) + (pageInfo (hasNextPage . :json-false) (endCursor . "cvi-cursor"))))))) + +(defun testutil-linear-fixture-issue-with-comments () + "An issue carrying a comments connection, oldest first." + `((id . "uuid-1") + (identifier . "ENG-42") + (title . "Fix the thing") + (description . "Body text") + (comments (nodes . (((id . "cm-1") (body . "First comment") + (createdAt . "2026-05-18T09:00:00.000Z") + (user . ((id . "user-2") (name . "Alice")))) + ((id . "cm-2") (body . "Second comment, **bold**") + (createdAt . "2026-05-19T10:30:00.000Z") + (user . ((id . "user-1") (name . "Craig"))))))))) + +(provide 'testutil-fixtures) +;;; testutil-fixtures.el ends here |
