emacs: Tests for user-defined sections

A new file was added for notmuch-hello tests.
This commit is contained in:
Daniel Schoepe 2012-02-17 18:48:08 +04:00 committed by David Bremner
parent 3557acab64
commit 6e25ea031f
9 changed files with 71 additions and 3 deletions

47
test/emacs-hello Executable file
View file

@ -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

View file

@ -6,9 +6,10 @@ Saved searches: [edit]
Search: .
[Show all tags]
All tags: [show]
Type a search query and hit RET to view matching threads.
Edit saved searches with the `edit' button.
Hit RET or click on a saved search or tag name to view matching threads.
`=' to refresh this screen. `s' to search messages. `q' to quit.
Customize this page.

View file

@ -0,0 +1,4 @@
Test: [hide]
52 inbox

View file

@ -2,9 +2,10 @@
Search: .
[Show all tags]
All tags: [show]
Type a search query and hit RET to view matching threads.
Edit saved searches with the `edit' button.
Hit RET or click on a saved search or tag name to view matching threads.
`=' to refresh this screen. `s' to search messages. `q' to quit.
Customize this page.

View file

@ -0,0 +1,5 @@
Test-with-counts: [hide]
2 attachment 7 signed
7 inbox 7 unread

View file

@ -0,0 +1,4 @@
Test-with-filtered: [hide]
4 attachment 52 inbox 7 signed

View file

@ -0,0 +1,4 @@
Test-with-empty: [hide]
52 inbox

View file

@ -6,9 +6,10 @@ Saved searches: [edit]
Search: .
[Show all tags]
All tags: [show]
Type a search query and hit RET to view matching threads.
Edit saved searches with the `edit' button.
Hit RET or click on a saved search or tag name to view matching threads.
`=' to refresh this screen. `s' to search messages. `q' to quit.
Customize this page.

View file

@ -54,6 +54,7 @@ TESTS="
argument-parsing
emacs-test-functions
emacs-address-cleaning
emacs-hello
emacs-show
"
TESTS=${NOTMUCH_TESTS:=$TESTS}