aboutsummaryrefslogtreecommitdiff
path: root/tests/test-nov-reading--config-defaults.el
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-07-19 21:10:40 -0500
committerCraig Jennings <c@cjennings.net>2026-07-19 21:10:40 -0500
commit18bcd567d1e7770b4e28c43eeefbf81696e2f4a3 (patch)
treec8921064ec1f05e328a895f24ca26352368b5c77 /tests/test-nov-reading--config-defaults.el
parent11eb84175a30b96e3fa179723bc486a88d102d05 (diff)
downloaddotemacs-18bcd567d1e7770b4e28c43eeefbf81696e2f4a3.tar.gz
dotemacs-18bcd567d1e7770b4e28c43eeefbf81696e2f4a3.zip
feat: add workflow font profiles
I replaced the mixed Fontaine presets with seven named profiles that persist across restarts. The mode line, echo area, and minibuffer stay in Berkeley Mono. Nov applies the shared Reading profile inside each EPUB buffer without changing the global selection.
Diffstat (limited to 'tests/test-nov-reading--config-defaults.el')
-rw-r--r--tests/test-nov-reading--config-defaults.el29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/test-nov-reading--config-defaults.el b/tests/test-nov-reading--config-defaults.el
index 5e454ce1..ff52d8f5 100644
--- a/tests/test-nov-reading--config-defaults.el
+++ b/tests/test-nov-reading--config-defaults.el
@@ -16,6 +16,8 @@
(declare-function cj/nov--next-reading-palette "nov-reading" (current names))
(defvar cj/nov-reading-palettes)
(defvar cj/nov-reading-default-palette)
+(defvar cj/nov-reading-profile)
+(defvar cj/nov--typography-remap-cookies)
(ert-deftest test-nov-reading-config-default-is-dark ()
"Normal: a fresh nov buffer opens on the dark palette."
@@ -34,5 +36,32 @@
(should-not (cj/nov--next-reading-palette "light" names))
(should (equal (cj/nov--next-reading-palette nil names) "dark"))))
+(ert-deftest test-nov-reading-config-uses-reading-font-profile ()
+ "Normal: nov typography names the shared Reading profile."
+ (should (eq cj/nov-reading-profile 'reading)))
+
+(ert-deftest test-nov-reading-depends-on-pure-profile-layer ()
+ "Boundary: loading nov shares profile data without loading Fontaine config."
+ (should (featurep 'font-profiles))
+ (should-not (featurep 'font-config)))
+
+(ert-deftest test-nov-reading-typography-remaps-shared-profile-locally ()
+ "Normal: nov applies Reading locally at its own base height without stacking."
+ (let ((cj/nov--typography-remap-cookies '(old-default old-fixed))
+ (removed nil)
+ (applied nil))
+ (cl-letf (((symbol-function 'face-remap-remove-relative)
+ (lambda (cookie) (push cookie removed)))
+ ((symbol-function 'cj/font-profile-remap-buffer)
+ (lambda (profile height)
+ (setq applied (list profile height))
+ '(new-default new-fixed))))
+ (cj/nov-reading-apply-typography))
+ (should (equal applied '(reading 180)))
+ (should (equal (sort removed #'string-lessp)
+ '(old-default old-fixed)))
+ (should (equal cj/nov--typography-remap-cookies
+ '(new-default new-fixed)))))
+
(provide 'test-nov-reading--config-defaults)
;;; test-nov-reading--config-defaults.el ends here