]> git.notmuchmail.org Git - notmuch/blob - contrib/notmuch-pick/test/emacs-pick
eed5f0211ab91d368b608951d1934ba39323de0a
[notmuch] / contrib / notmuch-pick / test / emacs-pick
1 #!/usr/bin/env bash
2
3 test_description="emacs pick interface"
4 . test-lib.sh
5
6 EXPECTED=$TEST_DIRECTORY/pick.expected-output
7
8 add_email_corpus
9 test_begin_subtest "Do we have emacs"
10 test_emacs '(insert "hello\n")
11             (test-output)'
12 cat <<EOF >EXPECTED
13 hello
14 EOF
15 test_expect_equal_file OUTPUT EXPECTED
16
17 test_begin_subtest "Basic notmuch-pick view in emacs"
18 test_emacs '(add-to-list (quote load-path) "'$PICK_DIR'")
19             (require (quote notmuch-pick))
20             (notmuch-pick "tag:inbox")
21             (notmuch-test-wait)
22             (test-output)
23             (delete-other-windows)'
24 test_expect_equal_file OUTPUT $EXPECTED/notmuch-pick-tag-inbox
25
26 test_begin_subtest "Navigation of notmuch-hello to search results"
27 test_emacs '(notmuch-hello)
28             (goto-char (point-min))
29             (re-search-forward "inbox")
30             (widget-button-press (1- (point)))
31             (notmuch-test-wait)
32             (notmuch-pick-from-search-current-query)
33             (notmuch-test-wait)
34             (test-output)
35             (delete-other-windows)'
36 test_expect_equal_file OUTPUT $EXPECTED/notmuch-pick-tag-inbox
37
38 test_begin_subtest "Pick of a single thread (from search)"
39 test_emacs '(notmuch-hello)
40             (goto-char (point-min))
41             (re-search-forward "inbox")
42             (widget-button-press (1- (point)))
43             (notmuch-test-wait)
44             (notmuch-pick-from-search-thread)
45             (notmuch-test-wait)
46             (test-output)
47             (delete-other-windows)'
48 test_expect_equal_file OUTPUT $EXPECTED/notmuch-pick-single-thread
49
50 test_begin_subtest "Pick of a single thread (from show)"
51 test_emacs '(notmuch-hello)
52             (goto-char (point-min))
53             (re-search-forward "inbox")
54             (widget-button-press (1- (point)))
55             (notmuch-test-wait)
56             (notmuch-search-show-thread)
57             (notmuch-pick-from-show-current-query)
58             (notmuch-test-wait)
59             (test-output)
60             (delete-other-windows)'
61 test_expect_equal_file OUTPUT $EXPECTED/notmuch-pick-single-thread
62
63 test_begin_subtest "Message window of pick"
64 test_emacs '(notmuch-hello)
65             (goto-char (point-min))
66             (re-search-forward "inbox")
67             (widget-button-press (1- (point)))
68             (notmuch-test-wait)
69             (notmuch-search-next-thread)
70             (notmuch-pick-from-search-thread)
71             (notmuch-test-wait)
72             (select-window notmuch-pick-message-window)
73             (test-output)
74             (delete-other-windows)'
75 cp OUTPUT /tmp/mjwout
76 test_expect_equal_file OUTPUT $EXPECTED/notmuch-pick-show-window
77
78 test_done