[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org 87e50f467a 4/4: test-org-fold.el: Add test for inli
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org 87e50f467a 4/4: test-org-fold.el: Add test for inline image displaying when cycling |
Date: |
Wed, 26 Oct 2022 00:58:22 -0400 (EDT) |
branch: externals/org
commit 87e50f467add3ddca635d32f97b9bd6061008faa
Author: stardiviner <numbchild@gmail.com>
Commit: Ihor Radchenko <yantar92@posteo.net>
test-org-fold.el: Add test for inline image displaying when cycling
* testing/lisp/test-org-fold.el
(test-org-fold/org-fold-display-inline-images):
Add unit test for inline image displaying when cycling.
---
.../examples/images/Org mode logo mono-color.png | Bin 0 -> 7523 bytes
testing/lisp/test-org-fold.el | 29 +++++++++++++++++++++
2 files changed, 29 insertions(+)
diff --git a/testing/examples/images/Org mode logo mono-color.png
b/testing/examples/images/Org mode logo mono-color.png
new file mode 100755
index 0000000000..9ac57e6a20
Binary files /dev/null and b/testing/examples/images/Org mode logo
mono-color.png differ
diff --git a/testing/lisp/test-org-fold.el b/testing/lisp/test-org-fold.el
index 8b19ffbc94..955ebc4170 100644
--- a/testing/lisp/test-org-fold.el
+++ b/testing/lisp/test-org-fold.el
@@ -662,6 +662,35 @@ Unfolded Paragraph.
(org-fold-check-before-invisible-edit kind)
(should (org-invisible-p (1- (point))))))))))
+(ert-deftest test-org-fold/org-fold-display-inline-images ()
+ "Test inline images displaying when cycling."
+ (let* ((org-cycle-inline-images-display t)
+ (images-dir (expand-file-name "examples/images/" org-test-dir))
+ (org-logo-image (expand-file-name "Org mode logo mono-color.png"
images-dir)))
+ ;; `org-cycle' -(state)-> `'children' display child inline images.
+ ;; TODO:
+
+ ;; `org-cycle' -(state)-> `'subtree' display subtrees inline images.
+ ;; TODO:
+
+ ;; `org-cycle' -(state)-> `'folded' remove inline image overlays.
+ (org-test-with-temp-text
+ (format "<point>* Heading 1
+[[file:%s]]
+** Subheading 1
+[[file:%s]]
+** Subheading 2
+[[file:%s]]" org-logo-image org-logo-image org-logo-image)
+ (org-overview)
+ (org-show-subtree)
+ (org-fold-subtree t)
+ (run-hook-with-args 'org-cycle-hook 'folded)
+ (should (null org-inline-image-overlays))
+ (should (null (overlays-in (point-min) (point-max))))
+ (org-show-subtree)
+ (should-not org-inline-image-overlays)
+ (should-not (overlays-in (point-min) (point-max))))))
+
(provide 'test-org-fold)
;;; test-org-fold.el ends here