]> git.notmuchmail.org Git - notmuch/blob - test/T358-emacs-protected-headers.sh
test: ensure that protected headers appear in notmuch-emacs search as expected
[notmuch] / test / T358-emacs-protected-headers.sh
1 #!/usr/bin/env bash
2
3 test_description="emacs interface"
4 . $(dirname "$0")/test-lib.sh || exit 1
5
6 # testing protected headers with emacs
7 add_gnupg_home
8 add_email_corpus protected-headers
9
10 test_begin_subtest "notmuch-search should show not unindexed protected subject header in emacs"
11 test_emacs '(notmuch-search "id:protected-header@crypto.notmuchmail.org")
12             (notmuch-test-wait)
13             (test-output)'
14 cat <<EOF >EXPECTED
15   2000-01-01 [1/1]   test_suite@notmuchmail.org  Subject Unavailable (encrypted inbox unread)
16 End of search results.
17 EOF
18 test_expect_equal_file EXPECTED OUTPUT
19
20 # protected headers should behave differently after re-indexing
21 test_begin_subtest 'defaulting to indexing cleartext'
22 test_expect_success 'notmuch config set index.decrypt true'
23 test_begin_subtest 'try reindexing protected header message'
24 test_expect_success 'notmuch reindex id:protected-header@crypto.notmuchmail.org'
25
26 test_begin_subtest "notmuch-search should show indexed protected subject header in emacs"
27 test_emacs '(notmuch-search "id:protected-header@crypto.notmuchmail.org")
28             (notmuch-test-wait)
29             (test-output)'
30 cat <<EOF >EXPECTED
31   2000-01-01 [1/1]   test_suite@notmuchmail.org  This is a protected header (encrypted inbox unread)
32 End of search results.
33 EOF
34 test_expect_equal_file EXPECTED OUTPUT
35
36 test_done