diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test-pearl-compose.el | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/test-pearl-compose.el b/tests/test-pearl-compose.el index 7029297..3e62c09 100644 --- a/tests/test-pearl-compose.el +++ b/tests/test-pearl-compose.el @@ -149,5 +149,28 @@ Binds `captured' to the value the on-finish receives (or `:none'). Stubs (goto-char (point-min)) (should (re-search-forward "Edited description" nil t)))))) +;;; compose-window display action + +(ert-deftest test-pearl-compose-display-action-defaults-to-bottom-fraction () + "By default the compose window opens at the bottom, sized to 30% of the frame." + (should (equal '((display-buffer-in-side-window) (side . bottom) (window-height . 0.3)) + (pearl--compose-display-action)))) + +(ert-deftest test-pearl-compose-display-action-honors-side-and-size () + "The side and size defcustoms drive the action; left/right size the width, +top/bottom the height, and the size passes through as float or integer." + (let ((pearl-compose-window-side 'right) + (pearl-compose-window-size 40)) + (should (equal '((display-buffer-in-side-window) (side . right) (window-width . 40)) + (pearl--compose-display-action)))) + (let ((pearl-compose-window-side 'top) + (pearl-compose-window-size 0.25)) + (should (equal '((display-buffer-in-side-window) (side . top) (window-height . 0.25)) + (pearl--compose-display-action)))) + (let ((pearl-compose-window-side 'left) + (pearl-compose-window-size 0.2)) + (should (equal '((display-buffer-in-side-window) (side . left) (window-width . 0.2)) + (pearl--compose-display-action))))) + (provide 'test-pearl-compose) ;;; test-pearl-compose.el ends here |
