aboutsummaryrefslogtreecommitdiff
path: root/tests/test-pearl-format.el
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-05-25 19:48:39 -0500
committerCraig Jennings <c@cjennings.net>2026-05-25 19:48:39 -0500
commit648893bd6ff5f4c403733d03258dbf3e91f2394b (patch)
tree3556dde1c81bf9ba0caf62ad6670803d03a60432 /tests/test-pearl-format.el
parente7f15034f1b4dea7fb22ebc0f2f532ee06b3dd57 (diff)
downloadpearl-648893bd6ff5f4c403733d03258dbf3e91f2394b.tar.gz
pearl-648893bd6ff5f4c403733d03258dbf3e91f2394b.zip
feat(save): detect dirty structured fields against synced baselines
The save scan now flags priority, state, assignee, and labels as dirty when their live value differs from the synced baseline, so structured fields ride the same reconcile-at-save path as title and description. Each check is id/scalar-only and runs with no network: the priority cookie's number against LINEAR-PRIORITY, the explicit state id against LINEAR-STATE-ID-SYNCED (the picker arm — keyword cycling lands later), the assignee id against its baseline, and the label id set against its baseline (order-insensitive, since Linear label order isn't meaningful). A missing baseline on a legacy file reads as not-dirty; the saver's missing-property guard covers that edge. This also makes the priority cookie faithful. The renderer mapped both None and Medium to [#C], so a None issue couldn't be told apart from a Medium one and would have read dirty the moment its baseline said 0. None now renders with no cookie, 1:1 with the four cookie levels — matching what the priority setter already did.
Diffstat (limited to 'tests/test-pearl-format.el')
-rw-r--r--tests/test-pearl-format.el4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/test-pearl-format.el b/tests/test-pearl-format.el
index a642b53..ece64d3 100644
--- a/tests/test-pearl-format.el
+++ b/tests/test-pearl-format.el
@@ -105,7 +105,7 @@
"Null/missing optional fields render as empty values, and the body is empty."
(test-pearl--with-default-mapping
(let ((out (pearl--format-issue-as-org-entry (test-pearl--norm-bare))))
- (should (string-match-p "^\\*\\* TODO \\[#C\\] ENG-7: Bare Issue$" out))
+ (should (string-match-p "^\\*\\* TODO ENG-7: Bare Issue$" out))
(should (string-match-p "^:LINEAR-PROJECT-NAME: +$" out))
(should (string-match-p "^:LINEAR-ASSIGNEE-NAME: +$" out))
(should (string-match-p "^:LINEAR-LABELS: +\\[\\]$" out))
@@ -174,7 +174,7 @@ sort together (org-sort on the parent) instead of being orphan headings."
(let ((out (pearl--build-org-content
(list (test-pearl--norm-full) (test-pearl--norm-bare)))))
(should (string-match-p "^\\*\\* IN-PROGRESS \\[#B\\] ENG-42: Fix the Thing$" out))
- (should (string-match-p "^\\*\\* TODO \\[#C\\] ENG-7: Bare Issue$" out)))))
+ (should (string-match-p "^\\*\\* TODO ENG-7: Bare Issue$" out)))))
;;; --restore-page-visibility