Integration test of sending and manual appending to Sent mailbox

This commit is contained in:
Michal Horejsek
2020-11-10 11:43:53 +01:00
parent ba65494fce
commit 53404122cc
2 changed files with 54 additions and 0 deletions

View File

@ -0,0 +1,50 @@
Feature: SMTP sending with APPENDing to Sent
Background:
Given there is connected user "user"
And there is IMAP client logged in as "user"
And there is IMAP client selected in "Sent"
And there is SMTP client logged in as "user"
Scenario: Send message and append to Sent
# First do sending.
When SMTP client sends message
"""
To: Internal Bridge <bridgetest@protonmail.com>
Subject: Manual send and append
Message-ID: bridgemessage42
hello
"""
Then SMTP response is "OK"
And mailbox "Sent" for "user" has 1 messages
And mailbox "Sent" for "user" has messages
| externalid | from | to | subject |
| bridgemessage42 | [userAddress] | bridgetest@protonmail.com | Manual send and append |
And message is sent with API call:
"""
{
"Message": {
"Subject": "Manual send and append",
"ExternalID": "bridgemessage42"
}
}
"""
# Then simulate manual append to Sent mailbox - message should be detected as a duplicate.
When IMAP client imports message to "Sent"
"""
To: Internal Bridge <bridgetest@protonmail.com>
Subject: Manual send and append
Message-ID: bridgemessage42
hello
"""
Then IMAP response is "OK"
And mailbox "Sent" for "user" has 1 messages
# Check that the external ID was not lost in the process.
When IMAP client sends command "FETCH 1 body.peek[header]"
Then IMAP response is "OK"
And IMAP response contains "bridgemessage42"

View File

@ -211,6 +211,10 @@ func messagesContainsMessageRow(account *accounts.TestAccount, allMessages []int
if message.ID != id {
matches = false
}
case "externalid":
if message.ExternalID != cell.Value {
matches = false
}
case "from": //nolint[goconst]
address := ctx.EnsureAddress(account.Username(), cell.Value)
if !areAddressesSame(message.Sender.Address, address) {