;;; test-pearl-sync-hooks.el --- Tests for pearl org sync hooks -*- lexical-binding: t; -*- ;; Copyright (C) 2026 Craig Jennings ;; Author: Craig Jennings ;; 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 . ;;; Commentary: ;; Save-model-v2 removed the opt-in org-sync mode. The after-save and ;; TODO-cycle hooks that pushed Linear state immediately are gone -- every push ;; now goes through the save engine (pearl-save-issue / pearl-save-all). These ;; tests assert the removal: the sync commands no longer exist, and cycling a ;; TODO keyword pushes nothing. ;;; Code: (require 'test-bootstrap (expand-file-name "test-bootstrap.el")) (require 'cl-lib) (ert-deftest test-pearl-org-sync-commands-removed () "The opt-in org-sync mode and its push machinery no longer exist." (should-not (fboundp 'pearl-enable-org-sync)) (should-not (fboundp 'pearl-disable-org-sync)) (should-not (fboundp 'pearl-org-hook-function)) (should-not (fboundp 'pearl-sync-org-to-linear)) (should-not (fboundp 'pearl-sync-current-heading-to-linear))) (ert-deftest test-pearl-keyword-cycle-pushes-nothing () "Cycling a TODO keyword pushes nothing -- pearl wires no TODO-cycle sync hook." (let ((pushed nil)) (cl-letf (((symbol-function 'pearl--update-issue-async) (lambda (&rest _) (setq pushed t)))) (with-temp-buffer (let ((org-todo-keywords '((sequence "TODO" "DONE")))) (insert "*** TODO Title\n:PROPERTIES:\n:LINEAR-ID: a\n:END:\n") (org-mode) (goto-char (point-min)) (org-todo "DONE")) (should-not pushed))))) (provide 'test-pearl-sync-hooks) ;;; test-pearl-sync-hooks.el ends here