summaryrefslogtreecommitdiff
path: root/tests/ss-capture-tests.el
diff options
context:
space:
mode:
authorSzymon Szukalski <szymon@szymonszukalski.com>2026-04-09 11:37:31 +1000
committerSzymon Szukalski <szymon@szymonszukalski.com>2026-04-09 11:37:31 +1000
commit8fa5aa983a7be1be78d736223d733f1da1330ec2 (patch)
tree6009f2973ea2b0268295c8f7fef7e48f7332bd25 /tests/ss-capture-tests.el
parent08d06ed00c9d6e98f0f8a02d243a2eb36ee4bff1 (diff)
Refine journal open shortcuts
Diffstat (limited to 'tests/ss-capture-tests.el')
-rw-r--r--tests/ss-capture-tests.el31
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/ss-capture-tests.el b/tests/ss-capture-tests.el
index 4ea4ff6..0af27a5 100644
--- a/tests/ss-capture-tests.el
+++ b/tests/ss-capture-tests.el
@@ -53,6 +53,37 @@
(when (file-exists-p file)
(delete-file file)))))
+(ert-deftest ss-open-journal-reveals-folded-today-subtree ()
+ (let* ((file (make-temp-file "ss-journal" nil ".org"))
+ (ss-journal-file file))
+ (unwind-protect
+ (progn
+ (with-temp-file file
+ (insert "#+title: Journal\n"
+ "* 2026\n"
+ "** 2026-04-09 Thursday\n"
+ "*** Notes\n"
+ "Body\n"))
+ (with-current-buffer (find-file-noselect file)
+ (org-overview))
+ (let ((org-overriding-default-time (encode-time 0 0 12 9 4 2026)))
+ (ss-open-journal)
+ (should (buffer-narrowed-p))
+ (should-not
+ (save-excursion
+ (goto-char (point-min))
+ (re-search-forward "^\\*\\*\\* Notes$" nil t)
+ (invisible-p (point))))
+ (should-not
+ (save-excursion
+ (goto-char (point-min))
+ (re-search-forward "^Body$" nil t)
+ (invisible-p (point))))))
+ (when (buffer-live-p (current-buffer))
+ (kill-buffer (current-buffer)))
+ (when (file-exists-p file)
+ (delete-file file)))))
+
(ert-deftest ss-open-journal-keeps-end-fallback-when-today-missing ()
(let* ((file (make-temp-file "ss-journal" nil ".org"))
(ss-journal-file file))