diff options
| author | Craig Jennings <c@cjennings.net> | 2026-06-15 21:55:53 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-06-15 21:55:53 -0500 |
| commit | 1eb7a353fc1dcb16d660121938a728d9b6b83fc0 (patch) | |
| tree | dad5bc2bb330c648430834129cee0cb84014dc9f | |
| parent | 60f14d2c1aa5074f23ec5bccfa0d233ec6730bdb (diff) | |
| download | dotemacs-1eb7a353fc1dcb16d660121938a728d9b6b83fc0.tar.gz dotemacs-1eb7a353fc1dcb16d660121938a728d9b6b83fc0.zip | |
test(ai-term): pin display-saved defaults via stubbed direction
The aspect-ratio rework dropped env-laptop-p from the direction logic, so these tests stubbed a dead function and depended on the batch frame's real dimensions. Stub cj/--ai-term-default-direction directly.
| -rw-r--r-- | tests/test-ai-term--display-saved.el | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/tests/test-ai-term--display-saved.el b/tests/test-ai-term--display-saved.el index 8b689aa6b..51c22fde9 100644 --- a/tests/test-ai-term--display-saved.el +++ b/tests/test-ai-term--display-saved.el @@ -32,13 +32,12 @@ "Normal: nil state on a desktop -> rightmost, size=cj/ai-term-desktop-width. The cardinal `right' default maps to the frame-edge variant `rightmost' so agent lands at the frame's right edge regardless of -which window is selected. `env-laptop-p' is stubbed nil to pin the -desktop branch." +which window is selected. The default direction is stubbed `right'." (let (received-buf received-alist (cj/--ai-term-last-direction nil) (cj/--ai-term-last-size nil) (cj/ai-term-desktop-width 0.5)) - (cl-letf (((symbol-function 'env-laptop-p) (lambda () nil)) + (cl-letf (((symbol-function 'cj/--ai-term-default-direction) (lambda (&rest _) 'right)) ((symbol-function 'display-buffer-in-direction) (lambda (b a) (setq received-buf b received-alist a) @@ -49,16 +48,16 @@ desktop branch." (should (= (cdr (assq 'window-width received-alist)) 0.5)) (should (eq (cdr (assq 'inhibit-same-window received-alist)) t)))) -(ert-deftest test-ai-term--display-saved-uses-laptop-defaults-when-state-nil () - "Normal: nil state on a laptop -> bottom, size=cj/ai-term-laptop-height. +(ert-deftest test-ai-term--display-saved-uses-below-default-when-state-nil () + "Normal: nil state with a `below' default -> bottom, size=cj/ai-term-laptop-height. The cardinal `below' default maps to the frame-edge variant `bottom' -and the size lands on the `window-height' axis. `env-laptop-p' is -stubbed t to pin the laptop branch." +and the size lands on the `window-height' axis. The default direction +is stubbed `below' (the size helper follows it)." (let (received-alist (cj/--ai-term-last-direction nil) (cj/--ai-term-last-size nil) (cj/ai-term-laptop-height 0.75)) - (cl-letf (((symbol-function 'env-laptop-p) (lambda () t)) + (cl-letf (((symbol-function 'cj/--ai-term-default-direction) (lambda (&rest _) 'below)) ((symbol-function 'display-buffer-in-direction) (lambda (_b a) (setq received-alist a) 'fake-window))) (cj/--ai-term-display-saved 'fake-buf '((inhibit-same-window . t)))) |
