aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-06-24 05:54:19 -0400
committerCraig Jennings <c@cjennings.net>2026-06-24 05:54:19 -0400
commitde0c3f89889ed05e906dceaddf4068f2d417a0ac (patch)
tree4c54aa61ee3b7b999c92d951f8518437e1085207 /tests
parent99cb7324bbd29342f57fa07dec74c366b9195382 (diff)
downloaddotemacs-de0c3f89889ed05e906dceaddf4068f2d417a0ac.tar.gz
dotemacs-de0c3f89889ed05e906dceaddf4068f2d417a0ac.zip
test(nerd-icons): dir-precedence probe + legend round-trip (phase 4)
Lock the dir-precedence decision with an ERT probe: when a dir icon already carries nerd-icons-completion-dir-face, the advice's prepended nerd-icons-yellow is first in the face list and wins. Extend the #nerdiconstest browser gate with an export/import round-trip over an assigned nerd-icons color, asserting it re-imports to the same state and that the separate nerd-icons-completion dir-face stays out of the nerd-icons app. Claude-Session: https://claude.ai/code/session_01BqrdWUo9GcznYX2pZr76gZ
Diffstat (limited to 'tests')
-rw-r--r--tests/test-nerd-icons-config--color-dir.el15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/test-nerd-icons-config--color-dir.el b/tests/test-nerd-icons-config--color-dir.el
index 808c0dc34..2ae64a810 100644
--- a/tests/test-nerd-icons-config--color-dir.el
+++ b/tests/test-nerd-icons-config--color-dir.el
@@ -53,5 +53,20 @@ renders would stack `nerd-icons-yellow' over and over on the cached string."
(yellows (cl-count 'nerd-icons-yellow specs)))
(should (= yellows 1)))))
+(ert-deftest test-nerd-icons-config--color-dir-precedence-over-completion-face ()
+ "Normal: when the dir icon already carries nerd-icons-completion-dir-face
+\(what `nerd-icons-completion-get-icon' passes), the advice prepends
+nerd-icons-yellow so it is first in the face list and wins the merge. Locks
+the dir-precedence decision: the prepended advice face outranks the package's
+:face, even though that face lives in a different package."
+ (let* ((icon (propertize "X" 'face 'nerd-icons-completion-dir-face))
+ (result (cj/--nerd-icons-color-dir icon))
+ (faces (ensure-list (get-text-property 0 'face result))))
+ (should (memq 'nerd-icons-yellow faces))
+ (should (memq 'nerd-icons-completion-dir-face faces))
+ (should (= 0 (cl-position 'nerd-icons-yellow faces)))
+ (should (< (cl-position 'nerd-icons-yellow faces)
+ (cl-position 'nerd-icons-completion-dir-face faces)))))
+
(provide 'test-nerd-icons-config--color-dir)
;;; test-nerd-icons-config--color-dir.el ends here