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/test-pearl-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/test-pearl-fixtures.el')
| -rw-r--r-- | tests/test-pearl-fixtures.el | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/tests/test-pearl-fixtures.el b/tests/test-pearl-fixtures.el new file mode 100644 index 0000000..dfd9e1d --- /dev/null +++ b/tests/test-pearl-fixtures.el @@ -0,0 +1,68 @@ +;;; test-pearl-fixtures.el --- smoke tests for the API fixtures -*- lexical-binding: t; -*- + +;; Copyright (C) 2026 Craig Jennings + +;; Author: Craig Jennings <c@cjennings.net> + +;; This program is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see <http://www.gnu.org/licenses/>. + +;;; Commentary: + +;; Smoke tests for `testutil-fixtures'. The fixtures exist for the upcoming +;; query/representation tests, which don't exist yet, so without this file the +;; suite would never load the fixtures and a syntax slip or shape change would +;; rot unnoticed. These assertions exercise the file and lock the key shapes +;; the consuming tests will rely on (json-read conventions: missing keys for +;; absent fields, `t' / `:json-false' booleans). + +;;; Code: + +(require 'test-bootstrap (expand-file-name "test-bootstrap.el")) +(require 'testutil-fixtures (expand-file-name "testutil-fixtures.el")) + +(ert-deftest test-pearl-fixture-assigned-page-shape () + "The assignedIssues page fixture has nodes and a pageInfo." + (let* ((page (testutil-linear-fixture-assigned-issues-page)) + (conn (cdr (assoc 'assignedIssues + (assoc 'viewer (assoc 'data page)))))) + (should (= 2 (length (cdr (assoc 'nodes conn))))) + (should (eq :json-false (cdr (assoc 'hasNextPage (assoc 'pageInfo conn))))))) + +(ert-deftest test-pearl-fixture-null-fields-omits-optionals () + "The null-fields issue carries empty/absent project, assignee, and labels." + (let ((issue (testutil-linear-fixture-issue-null-fields))) + ;; present-but-empty: the key exists with a nil value (JSON null) + (should (assoc 'project issue)) + (should (null (cdr (assoc 'project issue)))) + (should (null (cdr (assoc 'assignee issue)))) + ;; labels is an empty connection, not missing + (should (null (cdr (assoc 'nodes (assoc 'labels issue))))))) + +(ert-deftest test-pearl-fixture-custom-views-shape () + "The customViews fixture exposes named views with a shared flag." + (let* ((views (cdr (assoc 'nodes (assoc 'customViews + (assoc 'data (testutil-linear-fixture-custom-views))))))) + (should (= 2 (length views))) + (should (string-equal "My open work" (cdr (assoc 'name (car views))))) + (should (eq t (cdr (assoc 'shared (cadr views))))))) + +(ert-deftest test-pearl-fixture-comments-oldest-first () + "The issue-with-comments fixture orders comments oldest first." + (let ((comments (cdr (assoc 'nodes (assoc 'comments + (testutil-linear-fixture-issue-with-comments)))))) + (should (= 2 (length comments))) + (should (string-equal "First comment" (cdr (assoc 'body (car comments))))))) + +(provide 'test-pearl-fixtures) +;;; test-pearl-fixtures.el ends here |
