mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-21 18:38:08 +01:00
emacs: Tests for user-defined sections
A new file was added for notmuch-hello tests.
This commit is contained in:
parent
3557acab64
commit
6e25ea031f
9 changed files with 71 additions and 3 deletions
47
test/emacs-hello
Executable file
47
test/emacs-hello
Executable 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
|
|
@ -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.
|
||||
|
|
4
test/emacs.expected-output/notmuch-hello-new-section
Normal file
4
test/emacs.expected-output/notmuch-hello-new-section
Normal file
|
@ -0,0 +1,4 @@
|
|||
Test: [hide]
|
||||
|
||||
52 inbox
|
||||
|
|
@ -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.
|
||||
|
|
5
test/emacs.expected-output/notmuch-hello-section-counts
Normal file
5
test/emacs.expected-output/notmuch-hello-section-counts
Normal file
|
@ -0,0 +1,5 @@
|
|||
Test-with-counts: [hide]
|
||||
|
||||
2 attachment 7 signed
|
||||
7 inbox 7 unread
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
Test-with-filtered: [hide]
|
||||
|
||||
4 attachment 52 inbox 7 signed
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
Test-with-empty: [hide]
|
||||
|
||||
52 inbox
|
||||
|
|
@ -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.
|
||||
|
|
|
@ -54,6 +54,7 @@ TESTS="
|
|||
argument-parsing
|
||||
emacs-test-functions
|
||||
emacs-address-cleaning
|
||||
emacs-hello
|
||||
emacs-show
|
||||
"
|
||||
TESTS=${NOTMUCH_TESTS:=$TESTS}
|
||||
|
|
Loading…
Reference in a new issue