branch: externals/hyperbole
commit dac958d1522ecf2ef8ff9ecca38d4370cbe4ef97
Author: Mats Lidell <[email protected]>
Commit: Mats Lidell <[email protected]>

    Use preserve hywiki mode macro and refactor test to utilize that.
---
 ChangeLog            |  5 +++++
 test/hywiki-tests.el | 27 ++++++++++++---------------
 2 files changed, 17 insertions(+), 15 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index e8d9c1b284..5ae52ecb3a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2026-02-01  Mats Lidell  <[email protected]>
+
+* test/hywiki-tests.el (hywiki-tests--save-referent-find-use-menu): Use
+    hywiki-tests--preserve-hywiki-mode macro and refactor test to utilize that.
+
 2026-01-31  Bob Weiner  <[email protected]>
 
 * hproperty.el (hproperty:char-property-face-p): Rename to
diff --git a/test/hywiki-tests.el b/test/hywiki-tests.el
index bc103488f5..e251e38718 100644
--- a/test/hywiki-tests.el
+++ b/test/hywiki-tests.el
@@ -1448,21 +1448,18 @@ named WikiReferent with a non-page referent type."
 (ert-deftest hywiki-tests--save-referent-find-use-menu ()
   "Verify saving and loading a referent find works using Hyperbole's menu."
   (skip-unless (not noninteractive))
-  (hywiki-tests--referent-test
-    (progn
-      (sit-for 0.2)
-      (cons 'find #'hywiki-word-grep))
-    (let ((page (cdr (hywiki-add-page "WikiWord")))
-         (vertico-mode 0))
-      (unwind-protect
-          (progn
-            (find-file page)
-            (hywiki-tests--insert "\nWikiReferent\n")
-            (save-buffer)
-            (goto-char (point-min))
-            (should (hact 'kbd-key "C-u C-h hhc WikiReferent RET f RET"))
-            (hy-test-helpers:consume-input-events))
-        (hy-delete-file-and-buffer page)))))
+  (hywiki-tests--preserve-hywiki-mode
+    (hywiki-tests--referent-test
+      (progn
+        (sit-for 0.2)
+        (cons 'find #'hywiki-word-grep))
+      (let ((vertico-mode 0))
+        (find-file wiki-page)
+        (hywiki-tests--insert "\nWikiReferent\n")
+        (save-buffer)
+        (goto-char (point-min))
+        (should (hact 'kbd-key "C-u C-h hhc WikiReferent RET f RET"))
+        (hy-test-helpers:consume-input-events)))))
 
 ;; Global-button
 (ert-deftest hywiki-tests--save-referent-global-button ()

Reply via email to