test-org-fold/org-fold-display-inline-images: Fix test, disable when non-interactive

* testing/lisp/test-org-fold.el (test-org-fold/org-fold-display-inline-images):
This commit is contained in:
Ihor Radchenko 2024-02-02 16:24:32 +01:00
parent 844bd9f1f1
commit 1156554aaf
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
1 changed files with 12 additions and 4 deletions

View File

@ -694,6 +694,7 @@ Unfolded Paragraph.
(ert-deftest test-org-fold/org-fold-display-inline-images ()
"Test inline images displaying when cycling."
(skip-when noninteractive)
(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)))
@ -715,11 +716,18 @@ Unfolded Paragraph.
(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))))))
(should-not
(cl-every
(lambda (ov) (overlay-get ov 'org-image-overlay))
(overlays-in (point-min) (point-max))))
(org-show-subtree)
(run-hook-with-args 'org-cycle-hook 'subtree)
(should org-inline-image-overlays)
(should
(cl-every
(lambda (ov) (overlay-get ov 'org-image-overlay))
(overlays-in (point-min) (point-max)))))))
(provide 'test-org-fold)