aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/emacs-hello
diff options
context:
space:
mode:
authorGravatar Daniel Schoepe <daniel.schoepe@googlemail.com>2012-02-17 18:48:08 +0400
committerGravatar David Bremner <bremner@debian.org>2012-03-01 08:16:55 -0400
commit6e25ea031fc43dd3a6a9ff00f33526fdd3abc92a (patch)
tree74a0716894eb241b5cbf75fe703203ffc85da02e /test/emacs-hello
parent3557acab6419c7b9ad9a19c5eb6c305b1184bcf8 (diff)
emacs: Tests for user-defined sections
A new file was added for notmuch-hello tests.
Diffstat (limited to 'test/emacs-hello')
-rwxr-xr-xtest/emacs-hello47
1 files changed, 47 insertions, 0 deletions
diff --git a/test/emacs-hello b/test/emacs-hello
new file mode 100755
index 00000000..b235e3ab
--- /dev/null
+++ b/test/emacs-hello
@@ -0,0 +1,47 @@
+#!/usr/bin/env bash
+
+test_description="Testing emacs notmuch-hello view"
+. test-lib.sh
+
+EXPECTED=$TEST_DIRECTORY/emacs.expected-output
+
+add_email_corpus
+
+test_begin_subtest "User-defined section with inbox tag"
+test_emacs "(let ((notmuch-hello-sections
+ (list (lambda () (notmuch-hello-insert-searches
+ \"Test\" '((\"inbox\" . \"tag:inbox\")))))))
+ (notmuch-hello)
+ (test-output))"
+test_expect_equal_file OUTPUT $EXPECTED/notmuch-hello-new-section
+
+test_begin_subtest "User-defined section with empty, hidden entry"
+test_emacs "(let ((notmuch-hello-sections
+ (list (lambda () (notmuch-hello-insert-searches
+ \"Test-with-empty\"
+ '((\"inbox\" . \"tag:inbox\")
+ (\"doesnotexist\" . \"tag:doesnotexist\"))
+ :hide-empty-searches t)))))
+ (notmuch-hello)
+ (test-output))"
+test_expect_equal_file OUTPUT $EXPECTED/notmuch-hello-section-with-empty
+
+test_begin_subtest "User-defined section, unread tag filtered out"
+test_emacs "(let ((notmuch-hello-sections
+ (list (lambda () (notmuch-hello-insert-tags-section
+ \"Test-with-filtered\"
+ :hide-tags '(\"unread\"))))))
+ (notmuch-hello)
+ (test-output))"
+test_expect_equal_file OUTPUT $EXPECTED/notmuch-hello-section-hidden-tag
+
+test_begin_subtest "User-defined section, different query for counts"
+test_emacs "(let ((notmuch-hello-sections
+ (list (lambda () (notmuch-hello-insert-tags-section
+ \"Test-with-counts\"
+ :filter-count \"tag:signed\")))))
+ (notmuch-hello)
+ (test-output))"
+test_expect_equal_file OUTPUT $EXPECTED/notmuch-hello-section-counts
+
+test_done