GODT-1021 Do not allow copy Inbox->Sent or Sent->Inbox

This commit is contained in:
Michal Horejsek
2021-02-05 07:51:02 +01:00
committed by Jakub Cuth
parent 4ab5635293
commit 6299a6d390
3 changed files with 50 additions and 2 deletions

View File

@ -7,10 +7,13 @@ Feature: IMAP copy messages
| from | to | subject | body | read | deleted |
| john.doe@mail.com | user@pm.me | foo | hello | true | false |
| jane.doe@mail.com | name@pm.me | bar | world | false | true |
And there are messages in mailbox "Sent" for "user"
| from | to | subject | body |
| john.doe@mail.com | user@pm.me | response | hello |
And there is IMAP client logged in as "user"
And there is IMAP client selected in "INBOX"
Scenario: Copy message to label
Given there is IMAP client selected in "INBOX"
When IMAP client copies message seq "1" to "Labels/label"
Then IMAP response is "OK"
And mailbox "INBOX" for "user" has messages
@ -22,6 +25,7 @@ Feature: IMAP copy messages
| john.doe@mail.com | user@pm.me | foo | hello | true | false |
Scenario: Copy all messages to label
Given there is IMAP client selected in "INBOX"
When IMAP client copies message seq "1:*" to "Labels/label"
Then IMAP response is "OK"
And mailbox "INBOX" for "user" has messages
@ -34,6 +38,7 @@ Feature: IMAP copy messages
| jane.doe@mail.com | name@pm.me | bar | world | false | true |
Scenario: Copy message to folder does move
Given there is IMAP client selected in "INBOX"
When IMAP client copies message seq "1" to "Folders/mbox"
Then IMAP response is "OK"
And mailbox "INBOX" for "user" has messages
@ -44,6 +49,7 @@ Feature: IMAP copy messages
| john.doe@mail.com | user@pm.me | foo | hello | true | false |
Scenario: Copy all messages to folder does move
Given there is IMAP client selected in "INBOX"
When IMAP client copies message seq "1:*" to "Folders/mbox"
Then IMAP response is "OK"
And mailbox "INBOX" for "user" has 0 messages
@ -51,3 +57,13 @@ Feature: IMAP copy messages
| from | to | subject | body | read | deleted |
| john.doe@mail.com | user@pm.me | foo | hello | true | false |
| jane.doe@mail.com | name@pm.me | bar | world | false | true |
Scenario: Copy message from Inbox to Sent is not possible
Given there is IMAP client selected in "INBOX"
When IMAP client copies message seq "1" to "Sent"
Then IMAP response is "move from Inbox to Sent is not allowed"
Scenario: Copy message from Sent to Inbox is not possible
Given there is IMAP client selected in "Sent"
When IMAP client copies message seq "1" to "INBOX"
Then IMAP response is "move from Sent to Inbox is not allowed"

View File

@ -8,6 +8,9 @@ Feature: IMAP move messages
| from | to | subject | body |
| john.doe@mail.com | user@pm.me | foo | hello |
| jane.doe@mail.com | name@pm.me | bar | world |
And there are messages in mailbox "Sent" for "user"
| from | to | subject | body |
| john.doe@mail.com | user@pm.me | response | hello |
And there are messages in mailbox "Labels/label2" for "user"
| from | to | subject | body |
| john.doe@mail.com | user@pm.me | baz | hello |
@ -87,3 +90,13 @@ Feature: IMAP move messages
| 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 not called
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"