2020-04-08 10:59:16 +00:00
|
|
|
Feature: IMAP move messages
|
|
|
|
Background:
|
|
|
|
Given there is connected user "user"
|
2021-01-12 09:04:15 +00:00
|
|
|
And there is "user" with mailbox "Folders/folder"
|
|
|
|
And there is "user" with mailbox "Labels/label"
|
|
|
|
And there is "user" with mailbox "Labels/label2"
|
2020-04-08 10:59:16 +00:00
|
|
|
And there are messages in mailbox "INBOX" for "user"
|
|
|
|
| from | to | subject | body |
|
|
|
|
| john.doe@mail.com | user@pm.me | foo | hello |
|
|
|
|
| jane.doe@mail.com | name@pm.me | bar | world |
|
2021-02-05 06:51:02 +00:00
|
|
|
And there are messages in mailbox "Sent" for "user"
|
|
|
|
| from | to | subject | body |
|
|
|
|
| john.doe@mail.com | user@pm.me | response | hello |
|
2021-01-12 09:04:15 +00:00
|
|
|
And there are messages in mailbox "Labels/label2" for "user"
|
|
|
|
| from | to | subject | body |
|
|
|
|
| john.doe@mail.com | user@pm.me | baz | hello |
|
2020-04-08 10:59:16 +00:00
|
|
|
And there is IMAP client logged in as "user"
|
|
|
|
|
2021-01-12 09:04:15 +00:00
|
|
|
Scenario: Move message from inbox (folder) to folder
|
|
|
|
Given there is IMAP client selected in "INBOX"
|
|
|
|
When IMAP client moves message seq "1" to "Folders/folder"
|
2020-04-08 10:59:16 +00:00
|
|
|
Then IMAP response is "OK"
|
|
|
|
And mailbox "INBOX" for "user" has messages
|
|
|
|
| from | to | subject |
|
|
|
|
| jane.doe@mail.com | name@pm.me | bar |
|
2021-01-12 09:04:15 +00:00
|
|
|
And mailbox "Folders/folder" for "user" has messages
|
2020-04-08 10:59:16 +00:00
|
|
|
| from | to | subject |
|
|
|
|
| john.doe@mail.com | user@pm.me | foo |
|
2021-01-12 09:04:15 +00:00
|
|
|
And API endpoint "PUT /mail/v4/messages/label" is called
|
|
|
|
And API endpoint "PUT /mail/v4/messages/unlabel" is not called
|
2020-04-08 10:59:16 +00:00
|
|
|
|
2021-01-12 09:04:15 +00:00
|
|
|
Scenario: Move all messages from inbox to folder
|
|
|
|
Given there is IMAP client selected in "INBOX"
|
|
|
|
When IMAP client moves message seq "1:*" to "Folders/folder"
|
2020-04-08 10:59:16 +00:00
|
|
|
Then IMAP response is "OK"
|
|
|
|
And mailbox "INBOX" for "user" has 0 messages
|
2021-01-12 09:04:15 +00:00
|
|
|
And mailbox "Folders/folder" for "user" has messages
|
|
|
|
| from | to | subject |
|
|
|
|
| john.doe@mail.com | user@pm.me | foo |
|
|
|
|
| jane.doe@mail.com | name@pm.me | bar |
|
|
|
|
And API endpoint "PUT /mail/v4/messages/label" is called
|
|
|
|
And API endpoint "PUT /mail/v4/messages/unlabel" is not called
|
|
|
|
|
|
|
|
Scenario: Move message from folder to label (keeps in folder)
|
|
|
|
Given there is IMAP client selected in "INBOX"
|
|
|
|
When IMAP client moves message seq "1" to "Labels/label"
|
|
|
|
Then IMAP response is "OK"
|
|
|
|
And mailbox "INBOX" for "user" has messages
|
2020-04-08 10:59:16 +00:00
|
|
|
| from | to | subject |
|
|
|
|
| john.doe@mail.com | user@pm.me | foo |
|
|
|
|
| jane.doe@mail.com | name@pm.me | bar |
|
2021-01-12 09:04:15 +00:00
|
|
|
And mailbox "Labels/label" for "user" has messages
|
|
|
|
| from | to | subject |
|
|
|
|
| john.doe@mail.com | user@pm.me | foo |
|
|
|
|
And API endpoint "PUT /mail/v4/messages/label" is called
|
|
|
|
And API endpoint "PUT /mail/v4/messages/unlabel" is not called
|
|
|
|
|
|
|
|
Scenario: Move message from label to folder
|
|
|
|
Given there is IMAP client selected in "Labels/label2"
|
|
|
|
When IMAP client moves message seq "1" to "Folders/folder"
|
|
|
|
Then IMAP response is "OK"
|
|
|
|
And mailbox "Labels/label2" for "user" has 0 messages
|
|
|
|
And mailbox "Folders/folder" for "user" has messages
|
|
|
|
| from | to | subject |
|
|
|
|
| john.doe@mail.com | user@pm.me | baz |
|
|
|
|
And API endpoint "PUT /mail/v4/messages/label" is called
|
|
|
|
And API endpoint "PUT /mail/v4/messages/unlabel" is called
|
|
|
|
|
|
|
|
Scenario: Move message from label to label
|
|
|
|
Given there is IMAP client selected in "Labels/label2"
|
|
|
|
When IMAP client moves message seq "1" to "Labels/label"
|
|
|
|
Then IMAP response is "OK"
|
|
|
|
And mailbox "Labels/label2" for "user" has 0 messages
|
|
|
|
And mailbox "Labels/label" for "user" has messages
|
|
|
|
| from | to | subject |
|
|
|
|
| john.doe@mail.com | user@pm.me | baz |
|
|
|
|
And API endpoint "PUT /mail/v4/messages/label" is called
|
|
|
|
And API endpoint "PUT /mail/v4/messages/unlabel" is called
|
2020-04-08 10:59:16 +00:00
|
|
|
|
|
|
|
Scenario: Move message from All Mail is not possible
|
2021-01-12 09:04:15 +00:00
|
|
|
Given there is IMAP client selected in "All Mail"
|
|
|
|
When IMAP client moves message seq "1" to "Folders/folder"
|
2021-09-23 14:14:28 +00:00
|
|
|
Then IMAP response is "NO move from All Mail is not allowed"
|
2020-04-08 10:59:16 +00:00
|
|
|
And mailbox "All Mail" for "user" has messages
|
|
|
|
| from | to | subject |
|
|
|
|
| john.doe@mail.com | user@pm.me | foo |
|
|
|
|
| jane.doe@mail.com | name@pm.me | bar |
|
2021-09-23 14:14:28 +00:00
|
|
|
And mailbox "Folders/folder" for "user" has 0 messages
|
2021-02-05 06:51:02 +00:00
|
|
|
|
|
|
|
Scenario: Move message from Inbox to Sent is not possible
|
|
|
|
Given there is IMAP client selected in "INBOX"
|
|
|
|
When IMAP client moves message seq "1" to "Sent"
|
|
|
|
Then IMAP response is "move from Inbox to Sent is not allowed"
|
|
|
|
|
|
|
|
Scenario: Move message from Sent to Inbox is not possible
|
|
|
|
Given there is IMAP client selected in "Sent"
|
|
|
|
When IMAP client moves message seq "1" to "INBOX"
|
|
|
|
Then IMAP response is "move from Sent to Inbox is not allowed"
|