aboutsummaryrefslogtreecommitdiff
path: root/tests/test-integration-chime-mode.el
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test-integration-chime-mode.el')
-rw-r--r--tests/test-integration-chime-mode.el61
1 files changed, 61 insertions, 0 deletions
diff --git a/tests/test-integration-chime-mode.el b/tests/test-integration-chime-mode.el
new file mode 100644
index 0000000..a9a37f9
--- /dev/null
+++ b/tests/test-integration-chime-mode.el
@@ -0,0 +1,61 @@
+;;; test-integration-chime-mode.el --- Integration tests for chime-mode activation -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2024-2026 Craig Jennings
+
+;; Author: Craig Jennings <c@cjennings.net>
+
+;; This program is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Integration tests for chime-mode activation and deactivation.
+;; Tests the minor mode lifecycle: enabling adds modeline display,
+;; disabling removes it and cleans up state.
+
+;;; Code:
+
+;; Initialize package system for batch mode
+(when noninteractive
+ (package-initialize))
+
+(require 'ert)
+
+;; Load dependencies required by chime
+(require 'dash)
+(require 'alert)
+(require 'async)
+(require 'org-agenda)
+
+;; Load chime from parent directory
+(load (expand-file-name "../chime.el") nil t)
+
+;; Load test utilities
+(require 'testutil-general (expand-file-name "testutil-general.el"))
+(require 'testutil-time (expand-file-name "testutil-time.el"))
+(require 'testutil-events (expand-file-name "testutil-events.el"))
+
+;;; Tests
+
+(ert-deftest test-integration-chime-mode-enable-adds-to-global-mode-string ()
+ "Enabling chime-mode should add chime-modeline-string to global-mode-string."
+ (let ((chime-enable-modeline t)
+ (chime-modeline-lookahead-minutes 60))
+ (unwind-protect
+ (progn
+ (chime-mode 1)
+ (should (memq 'chime-modeline-string global-mode-string)))
+ (chime-mode -1))))
+
+(provide 'test-integration-chime-mode)
+;;; test-integration-chime-mode.el ends here