From 61bfb79f2c55983697f87b9ba3961a9fb46de2fe Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sun, 15 Feb 2026 19:58:15 -0600 Subject: test: add 86 new tests, fix 3 production bugs, fix 8 stale tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit New test coverage (86 tests across 7 files): - custom-case: 43 tests (title-case-region, upcase-dwim, downcase-dwim) - custom-datetime: 10 tests (all insert methods with mocked time) - config-utilities: 11 tests (format-build-time type branching) - org-capture-config: 22 tests (date-prefix + event-content) Production bugs found and fixed: - custom-case: title-case-region crashes on whitespace/punctuation-only input (char-after returns nil when no word chars found) - org-capture-config: browser branch missing empty-string guard on :initial plist value, producing stray newline in capture output - mousetrap-mode: keymap never registered in minor-mode-map-alist, so mode was silently not blocking any mouse events. Now pushes/removes on toggle. Additional fixes: - local-repository: fix cons cell syntax bug in localrepo-initialize (was calling vars as functions instead of using cons) - dupre-theme tests: update rainbow-delimiter color expectations - mousetrap tests: update dashboard profile (primary-click → scroll+primary) - music completion test: bind completion-ignore-case to prevent pollution - Delete redundant interactive recording test (duplicate of ERT version) Refactoring: - org-capture-config: extract cj/org-capture--date-prefix pure function from cj/org-capture-format-event-headline for testability Test checklist: todo.org updated to [11/25], removed untestable modules --- tests/test-integration-mousetrap-mode-lighter-click.el | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'tests/test-integration-mousetrap-mode-lighter-click.el') diff --git a/tests/test-integration-mousetrap-mode-lighter-click.el b/tests/test-integration-mousetrap-mode-lighter-click.el index fcae89a6..b9f32fda 100644 --- a/tests/test-integration-mousetrap-mode-lighter-click.el +++ b/tests/test-integration-mousetrap-mode-lighter-click.el @@ -14,7 +14,7 @@ (ert-deftest test-integration-lighter-click-enables-mode-in-dashboard () "Test clicking lighter in dashboard-mode enables mode with correct profile. -Dashboard uses primary-click profile which blocks scrolling but allows mouse-1." +Dashboard uses scroll+primary profile which allows scrolling and mouse-1." (with-temp-buffer (let ((major-mode 'dashboard-mode) (mouse-trap-mode nil)) @@ -27,12 +27,12 @@ Dashboard uses primary-click profile which blocks scrolling but allows mouse-1." ;; Mode should be enabled (should mouse-trap-mode) - ;; Keymap should be built for dashboard (primary-click profile) + ;; Keymap should be built for dashboard (scroll+primary profile) (should (keymapp mouse-trap-mode-map)) - ;; Verify profile-specific behavior: mouse-1 allowed, scroll blocked + ;; Verify profile-specific behavior: mouse-1 and scroll allowed (should (eq (lookup-key mouse-trap-mode-map (kbd "")) nil)) - (should (eq (lookup-key mouse-trap-mode-map (kbd "")) 'ignore)) + (should (eq (lookup-key mouse-trap-mode-map (kbd "")) nil)) ;; Keymap should be in minor-mode-map-alist (should (assq 'mouse-trap-mode minor-mode-map-alist))))) @@ -68,10 +68,10 @@ the keymap based on the CURRENT major mode's profile." (mouse-trap-mode 1) (should mouse-trap-mode) - ;; Should have dashboard profile (primary-click) + ;; Should have dashboard profile (scroll+primary) (let ((map1 mouse-trap-mode-map)) - (should (eq (lookup-key map1 (kbd "")) nil)) ; allowed - (should (eq (lookup-key map1 (kbd "")) 'ignore)) ; blocked + (should (eq (lookup-key map1 (kbd "")) nil)) ; allowed + (should (eq (lookup-key map1 (kbd "")) nil)) ; allowed ;; Disable (mouse-trap-mode -1) -- cgit v1.2.3