From a4a29cbf8257e8a0b5dce33e0e67d1ca700ccd37 Mon Sep 17 00:00:00 2001 From: Xavier Michelon Date: Thu, 23 Sep 2021 09:53:32 +0200 Subject: [PATCH] Other Improved tests in move_without_support --- .../imap/message/move_without_support.feature | 81 ++++++++----------- test/store_setup_test.go | 5 ++ 2 files changed, 40 insertions(+), 46 deletions(-) diff --git a/test/features/bridge/imap/message/move_without_support.feature b/test/features/bridge/imap/message/move_without_support.feature index eb4c4a09..36386223 100644 --- a/test/features/bridge/imap/message/move_without_support.feature +++ b/test/features/bridge/imap/message/move_without_support.feature @@ -5,55 +5,44 @@ Feature: IMAP move messages by append and delete (without MOVE support, e.g., Ou And there is IMAP client "source" logged in as "user" And there is IMAP client "target" logged in as "user" - Scenario Outline: Move message from INBOX to mailbox by append and delete - Given there are messages in mailbox "INBOX" for "user" - | id | from | to | subject | body | - | 1 | john.doe@mail.com | user@pm.me | foo | hello | - | 2 | jane.doe@mail.com | name@pm.me | bar | world | - And there is IMAP client "source" selected in "INBOX" - And there is IMAP client "target" selected in "" - When IMAP clients "source" and "target" move message seq "2" of "user" from "INBOX" to "" + Scenario Outline: Move message from to by + Given there are messages in mailbox "" for "user" + | id | from | to | subject | body | + | 1 | sndr1@pm.me | rcvr1@pm.me | subj1 | body1 | + | 2 | sndr2@pm.me | rcvr2@pm.me | subj2 | body2 | + And there is IMAP client "source" selected in "" + And there is IMAP client "target" selected in "" + When IMAP clients "source" and "target" move message seq "2" of "user" to "" by Then IMAP response to "source" is "OK" Then IMAP response to "target" is "OK" - When IMAP client "source" sends expunge - Then IMAP response to "source" is "OK" - And mailbox "INBOX" for "user" has messages - | from | to | subject | - | john.doe@mail.com | user@pm.me | foo | - And mailbox "" for "user" has messages - | from | to | subject | - | jane.doe@mail.com | name@pm.me | bar | - + And mailbox "" for "user" has 1 messages + And mailbox "" for "user" has messages + | from | to | subject | + | sndr2@pm.me | rcvr2@pm.me | subj2 | + And mailbox "" for "user" has 1 messages + And mailbox "" for "user" has messages + | from | to | subject | + | sndr1@pm.me | rcvr1@pm.me | subj1 | Examples: - | mailbox | - | Archive | - | Folders/mbox | - | Spam | - | Trash | - - Scenario Outline: Move message from Trash/Spam to INBOX by append and delete - Given there are messages in mailbox "" for "user" - | id | from | to | subject | body | - | 1 | john.doe@mail.com | user@pm.me | foo | hello | - | 2 | jane.doe@mail.com | name@pm.me | bar | world | - And there is IMAP client "source" selected in "" - And there is IMAP client "target" selected in "INBOX" - When IMAP clients "source" and "target" move message seq "2" of "user" from "" to "INBOX" - Then IMAP response to "source" is "OK" - Then IMAP response to "target" is "OK" - When IMAP client "source" sends expunge - Then IMAP response to "source" is "OK" - And mailbox "INBOX" for "user" has messages - | from | to | subject | - | jane.doe@mail.com | name@pm.me | bar | - And mailbox "" for "user" has messages - | from | to | subject | - | john.doe@mail.com | user@pm.me | foo | - - Examples: - | mailbox | - | Spam | - | Trash | + | srcMailbox | dstMailbox | order | + | Trash | INBOX | APPEND DELETE EXPUNGE | + | Spam | INBOX | APPEND DELETE EXPUNGE | + | INBOX | Archive | APPEND DELETE EXPUNGE | + | INBOX | Folders/mbox | APPEND DELETE EXPUNGE | + | INBOX | Spam | APPEND DELETE EXPUNGE | + | INBOX | Trash | APPEND DELETE EXPUNGE | + | Trash | INBOX | DELETE APPEND EXPUNGE | + | Spam | INBOX | DELETE APPEND EXPUNGE | + | INBOX | Archive | DELETE APPEND EXPUNGE | + | INBOX | Folders/mbox | DELETE APPEND EXPUNGE | + | INBOX | Spam | DELETE APPEND EXPUNGE | + | INBOX | Trash | DELETE APPEND EXPUNGE | + | Trash | INBOX | DELETE EXPUNGE APPEND | + | Spam | INBOX | DELETE EXPUNGE APPEND | + | INBOX | Archive | DELETE EXPUNGE APPEND | + | INBOX | Folders/mbox | DELETE EXPUNGE APPEND | + | INBOX | Spam | DELETE EXPUNGE APPEND | + | INBOX | Trash | DELETE EXPUNGE APPEND | Scenario Outline: Move message from to All Mail by Given there are messages in mailbox "" for "user" diff --git a/test/store_setup_test.go b/test/store_setup_test.go index e6b9eb35..4db566da 100644 --- a/test/store_setup_test.go +++ b/test/store_setup_test.go @@ -101,6 +101,11 @@ func thereAreMessagesInMailboxesForAddressOfUser(mailboxNames, bddAddressID, bdd if message.HasLabelID(pmapi.SentLabel) { message.Flags |= pmapi.FlagSent + } else { + // some tests (Outlook move by DELETE EXPUNGE APPEND) imply creating hard copies of emails, + // and the importMessage() function flags the email as Sent if the 'Received' key in not present in the + // header. + header.Add("Received", "from dummy.protonmail.com") } bddMessageID := ""