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