aboutsummaryrefslogtreecommitdiffstats
path: root/desktop/modules/mail/test-mail-notify.sh
diff options
context:
space:
mode:
Diffstat (limited to 'desktop/modules/mail/test-mail-notify.sh')
-rwxr-xr-xdesktop/modules/mail/test-mail-notify.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/desktop/modules/mail/test-mail-notify.sh b/desktop/modules/mail/test-mail-notify.sh
index 1c3e01a..4ca5d00 100755
--- a/desktop/modules/mail/test-mail-notify.sh
+++ b/desktop/modules/mail/test-mail-notify.sh
@@ -119,6 +119,19 @@ check "a newline in a subject stays on one row" \
"• Alice Example — line one line two" \
"$(build_body '[{"authors":"Alice Example","subject":"line one\nline two"}]' 1)"
+check "one action per thread, then the account as default" \
+ "00a1=Alice Example — First subject
+default=Open Work" \
+ "$(build_actions '[{"thread":"00a1","authors":"Alice Example","subject":"First subject"}]' Work)"
+
+check "a thread id that is not hex gets no action" \
+ "default=Open Work" \
+ "$(build_actions '[{"thread":"x=y","authors":"A","subject":"B"}]' Work)"
+
+check "malformed json still leaves the account action" \
+ "default=Open Work" \
+ "$(build_actions 'not json' Work)"
+
# A scratch state file, removed at exit. Never the real one: that is the
# user's live notification position, and a test must not move it.
tmpstate="$(mktemp)"