diff options
Diffstat (limited to 'tests/ss-capture-tests.el')
| -rw-r--r-- | tests/ss-capture-tests.el | 31 |
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)) |
