aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-05-22 20:20:25 -0500
committerCraig Jennings <c@cjennings.net>2026-05-22 20:20:25 -0500
commit5f8e1bc757fab620f5cf9b5fbc42b6a0030f5e53 (patch)
tree93e27f408f5965b20099434170ee2d21ddd04bec /tests
parent2c75893a6db2141099bc233f2b10dbb39cc5cf41 (diff)
downloaddotemacs-5f8e1bc757fab620f5cf9b5fbc42b6a0030f5e53.tar.gz
dotemacs-5f8e1bc757fab620f5cf9b5fbc42b6a0030f5e53.zip
refactor(org): give org-log-done a single home
`org-log-done` was set in two places: `cj/org-todo-settings` in org-config.el set it nil, and org-roam-config.el's `:config` set it to 'time. Whichever module loaded last won, so the effective value was load-order-dependent and fragile. I set it once in `cj/org-todo-settings` and dropped the org-roam-config setter, leaving a comment at the old site so it doesn't creep back. The value is 'time rather than nil because the dated-completion workflow wants a CLOSED timestamp stamped on every TODO->DONE.
Diffstat (limited to 'tests')
-rw-r--r--tests/test-org-config-org-log-done.el25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/test-org-config-org-log-done.el b/tests/test-org-config-org-log-done.el
new file mode 100644
index 00000000..2eedef2a
--- /dev/null
+++ b/tests/test-org-config-org-log-done.el
@@ -0,0 +1,25 @@
+;;; test-org-config-org-log-done.el --- Lock org-log-done to one home -*- lexical-binding: t; -*-
+
+;;; Commentary:
+;; `org-log-done' had two setters: `cj/org-todo-settings' in org-config.el set
+;; it nil and org-roam-config.el set it to 'time, so the effective value was
+;; load-order-dependent. `cj/org-todo-settings' is now the single home and
+;; sets 'time, which records a CLOSED timestamp on TODO->DONE — the behavior
+;; the dated-completion workflow depends on. This test calls the settings
+;; function in isolation (no org-roam-config required) so it would fail if the
+;; nil value or the org-roam duplicate ever came back.
+
+;;; Code:
+
+(require 'ert)
+(require 'org) ;; declares org-log-done special so the let below is dynamic
+(require 'org-config)
+
+(ert-deftest test-org-config-org-log-done-set-to-time ()
+ "Normal: cj/org-todo-settings sets org-log-done to 'time."
+ (let ((org-log-done nil))
+ (cj/org-todo-settings)
+ (should (eq org-log-done 'time))))
+
+(provide 'test-org-config-org-log-done)
+;;; test-org-config-org-log-done.el ends here