mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-11 05:06:51 +00:00
Other: Allow non-received messages to be imported to INBOX
This commit is contained in:
@ -15,6 +15,9 @@ Feature: IMAP create messages
|
||||
And IMAP client "1" sees the following messages in "INBOX":
|
||||
| from | to | subject | body |
|
||||
| john.doe@email.com | user@pm.me | foo | bar |
|
||||
And IMAP client "1" sees the following messages in "All Mail":
|
||||
| from | to | subject | body |
|
||||
| john.doe@email.com | user@pm.me | foo | bar |
|
||||
|
||||
Scenario: Creates draft
|
||||
When IMAP client "1" appends the following messages to "Drafts":
|
||||
@ -24,6 +27,9 @@ Feature: IMAP create messages
|
||||
And IMAP client "1" sees the following messages in "Drafts":
|
||||
| from | to | subject | body |
|
||||
| user@pm.me | john.doe@email.com | foo | bar |
|
||||
And IMAP client "1" sees the following messages in "All Mail":
|
||||
| from | to | subject | body |
|
||||
| user@pm.me | john.doe@email.com | foo | bar |
|
||||
|
||||
Scenario: Creates message sent from user's primary address
|
||||
When IMAP client "1" appends the following messages to "Sent":
|
||||
@ -33,6 +39,9 @@ Feature: IMAP create messages
|
||||
And IMAP client "1" sees the following messages in "Sent":
|
||||
| from | to | subject | body |
|
||||
| user@pm.me | john.doe@email.com | foo | bar |
|
||||
And IMAP client "1" sees the following messages in "All Mail":
|
||||
| from | to | subject | body |
|
||||
| user@pm.me | john.doe@email.com | foo | bar |
|
||||
|
||||
Scenario: Creates message sent from user's secondary address
|
||||
When IMAP client "1" appends the following messages to "Sent":
|
||||
@ -42,6 +51,9 @@ Feature: IMAP create messages
|
||||
And IMAP client "1" sees the following messages in "Sent":
|
||||
| from | to | subject | body |
|
||||
| alias@pm.me | john.doe@email.com | foo | bar |
|
||||
And IMAP client "1" sees the following messages in "All Mail":
|
||||
| from | to | subject | body |
|
||||
| alias@pm.me | john.doe@email.com | foo | bar |
|
||||
|
||||
Scenario: Imports an unrelated message to inbox
|
||||
When IMAP client "1" appends the following messages to "INBOX":
|
||||
@ -51,6 +63,9 @@ Feature: IMAP create messages
|
||||
And IMAP client "1" sees the following messages in "INBOX":
|
||||
| from | to | subject | body |
|
||||
| john.doe@email.com | john.doe2@pm.me | foo | bar |
|
||||
And IMAP client "1" sees the following messages in "All Mail":
|
||||
| from | to | subject | body |
|
||||
| john.doe@email.com | john.doe2@pm.me | foo | bar |
|
||||
|
||||
Scenario: Imports an unrelated message to sent
|
||||
When IMAP client "1" appends the following messages to "Sent":
|
||||
@ -59,4 +74,7 @@ Feature: IMAP create messages
|
||||
Then it succeeds
|
||||
And IMAP client "1" sees the following messages in "Sent":
|
||||
| from | to | subject | body |
|
||||
| john.doe@email.com | john.doe2@pm.me | foo | bar |
|
||||
| john.doe@email.com | john.doe2@pm.me | foo | bar |
|
||||
And IMAP client "1" sees the following messages in "All Mail":
|
||||
| from | to | subject | body |
|
||||
| john.doe@email.com | john.doe2@pm.me | foo | bar |
|
||||
|
||||
@ -74,13 +74,28 @@ Feature: IMAP import messages
|
||||
Hello
|
||||
"""
|
||||
Then it succeeds
|
||||
And IMAP client "1" eventually sees the following messages in "Sent":
|
||||
| from | to | subject | body |
|
||||
| foo@example.com | bridgetest@pm.test | Hello | Hello |
|
||||
And IMAP client "1" sees 0 messages in "Inbox"
|
||||
|
||||
Scenario: Import non-received message to Inbox
|
||||
When IMAP client "1" appends the following message to "Inbox":
|
||||
"""
|
||||
From: Foo <foo@example.com>
|
||||
To: Bridge Test <bridgetest@pm.test>
|
||||
Subject: Hello
|
||||
|
||||
Hello
|
||||
"""
|
||||
Then it succeeds
|
||||
And IMAP client "1" eventually sees the following messages in "INBOX":
|
||||
| from | to | subject | body |
|
||||
| foo@example.com | bridgetest@pm.test | Hello | Hello |
|
||||
And IMAP client "1" sees 0 messages in "Sent"
|
||||
|
||||
Scenario: Import non-received message to Inbox
|
||||
When IMAP client "1" appends the following message to "Inbox":
|
||||
Scenario: Import non-received message to Sent
|
||||
When IMAP client "1" appends the following message to "Sent":
|
||||
"""
|
||||
From: Foo <foo@example.com>
|
||||
To: Bridge Test <bridgetest@pm.test>
|
||||
@ -144,4 +159,4 @@ Feature: IMAP import messages
|
||||
--boundary--
|
||||
|
||||
"""
|
||||
Then it succeeds
|
||||
Then it succeeds
|
||||
|
||||
@ -144,7 +144,7 @@ func matchMessages(have, want []Message) error {
|
||||
})
|
||||
|
||||
if !IsSub(ToAny(have), ToAny(want)) {
|
||||
return fmt.Errorf("missing messages: %v", want)
|
||||
return fmt.Errorf("missing messages: have %+v, want %+v", have, want)
|
||||
}
|
||||
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user