]> git.notmuchmail.org Git - notmuch/blob - test/T730-emacs-forwarding.sh
emacs: Add new option notmuch-search-hide-excluded
[notmuch] / test / T730-emacs-forwarding.sh
1 #!/usr/bin/env bash
2
3 test_description="emacs forwarding"
4 . $(dirname "$0")/test-lib.sh || exit 1
5
6 test_require_emacs
7
8 test_begin_subtest "Forward setting the correct references header"
9 # Check that, when forwarding a message, the new message has
10 # a References-header pointing to the original (forwarded) message.
11
12 message_id='OriginalMessage@notmuchmail.org'
13 add_message \
14     [id]="$message_id" \
15     '[from]="user@example.com"' \
16     '[subject]="This is the original message"' \
17     '[body]="Dummy text."'
18
19 test_emacs_expect_t "
20   (let ((message-send-mail-function (lambda () t)))
21     (notmuch-show \"id:$message_id\")
22     (notmuch-show-forward-message)
23     (save-restriction
24       (message-narrow-to-headers)
25       (message-remove-header \"Fcc\")
26       (message-remove-header \"To\")
27       (message-add-header \"To: nobody@example.com\"))
28
29     (notmuch-mua-send)
30     (notmuch-test-expect-equal
31         (message-field-value \"References\") \"<$message_id>\"))
32 "
33
34 test_begin_subtest "Forwarding adding the forwarded tag"
35 # Check that sending the forwarding message in the previous
36 # subtest did add the forwarded-tag to the message that was forwarded.
37
38 test_expect_equal "$(notmuch search --output=tags id:$message_id | sort)" \
39 "forwarded
40 inbox
41 unread"
42
43 test_done