]> git.notmuchmail.org Git - notmuch/blob - contrib/notmuch-pick/test/emacs-pick
37f974ad435b9224c41d509a83690aa862b0579f
[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 "Refreshed notmuch-pick view in emacs"
27 test_emacs '(add-to-list (quote load-path) "'$PICK_DIR'")
28             (require (quote notmuch-pick))
29             (notmuch-pick "tag:inbox")
30             (notmuch-test-wait)
31             (notmuch-pick-refresh-view)
32             (notmuch-test-wait)
33             (test-output)
34             (delete-other-windows)'
35 test_expect_equal_file OUTPUT $EXPECTED/notmuch-pick-tag-inbox
36
37 test_begin_subtest "Navigation of notmuch-hello to search results"
38 test_emacs '(notmuch-hello)
39             (goto-char (point-min))
40             (re-search-forward "inbox")
41             (widget-button-press (1- (point)))
42             (notmuch-test-wait)
43             (notmuch-pick-from-search-current-query)
44             (notmuch-test-wait)
45             (test-output)
46             (delete-other-windows)'
47 test_expect_equal_file OUTPUT $EXPECTED/notmuch-pick-tag-inbox
48
49 test_begin_subtest "Pick of a single thread (from search)"
50 test_emacs '(notmuch-hello)
51             (goto-char (point-min))
52             (re-search-forward "inbox")
53             (widget-button-press (1- (point)))
54             (notmuch-test-wait)
55             (notmuch-pick-from-search-thread)
56             (notmuch-test-wait)
57             (test-output)
58             (delete-other-windows)'
59 test_expect_equal_file OUTPUT $EXPECTED/notmuch-pick-single-thread
60
61 test_begin_subtest "Pick of a single thread (from show)"
62 test_emacs '(notmuch-hello)
63             (goto-char (point-min))
64             (re-search-forward "inbox")
65             (widget-button-press (1- (point)))
66             (notmuch-test-wait)
67             (notmuch-search-show-thread)
68             (notmuch-pick-from-show-current-query)
69             (notmuch-test-wait)
70             (test-output)
71             (delete-other-windows)'
72 test_expect_equal_file OUTPUT $EXPECTED/notmuch-pick-single-thread
73
74 test_begin_subtest "Message window of pick"
75 test_emacs '(notmuch-hello)
76             (goto-char (point-min))
77             (re-search-forward "inbox")
78             (widget-button-press (1- (point)))
79             (notmuch-test-wait)
80             (notmuch-search-next-thread)
81             (notmuch-pick-from-search-thread)
82             (notmuch-test-wait)
83             (select-window notmuch-pick-message-window)
84             (test-output)
85             (delete-other-windows)'
86 cp OUTPUT /tmp/mjwout
87 test_expect_equal_file OUTPUT $EXPECTED/notmuch-pick-show-window
88
89 test_done