mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-23 10:26:44 +00:00
Tests for deleted flag GODT-496
This commit is contained in:
@ -4,42 +4,50 @@ Feature: IMAP copy messages
|
||||
And there is "user" with mailbox "Folders/mbox"
|
||||
And there is "user" with mailbox "Labels/label"
|
||||
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 |
|
||||
| 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 is IMAP client logged in as "user"
|
||||
And there is IMAP client selected in "INBOX"
|
||||
|
||||
Scenario: Copy message to label
|
||||
When IMAP client copies messages "2" to "Labels/label"
|
||||
Then IMAP response is "OK"
|
||||
And mailbox "INBOX" for "user" has 2 messages
|
||||
And mailbox "INBOX" for "user" has 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 mailbox "Labels/label" for "user" has messages
|
||||
| from | to | subject |
|
||||
| john.doe@mail.com | user@pm.me | foo |
|
||||
| from | to | subject | body | read | deleted |
|
||||
| jane.doe@mail.com | name@pm.me | bar | world | false | true |
|
||||
|
||||
Scenario: Copy all messages to label
|
||||
When IMAP client copies messages "1:*" to "Labels/label"
|
||||
Then IMAP response is "OK"
|
||||
And mailbox "INBOX" for "user" has 2 messages
|
||||
And mailbox "INBOX" for "user" has 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 mailbox "Labels/label" for "user" has messages
|
||||
| from | to | subject |
|
||||
| john.doe@mail.com | user@pm.me | foo |
|
||||
| jane.doe@mail.com | name@pm.me | bar |
|
||||
| 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 to folder does move
|
||||
When IMAP client copies messages "2" to "Folders/mbox"
|
||||
Then IMAP response is "OK"
|
||||
And mailbox "INBOX" for "user" has 1 message
|
||||
And mailbox "INBOX" for "user" has messages
|
||||
| from | to | subject | body | read | deleted |
|
||||
| john.doe@mail.com | user@pm.me | foo | hello | true | false |
|
||||
And mailbox "Folders/mbox" for "user" has messages
|
||||
| from | to | subject |
|
||||
| john.doe@mail.com | user@pm.me | foo |
|
||||
| from | to | subject | body | read | deleted |
|
||||
| jane.doe@mail.com | name@pm.me | bar | world | false | true |
|
||||
|
||||
Scenario: Copy all messages to folder does move
|
||||
When IMAP client copies messages "1:*" to "Folders/mbox"
|
||||
Then IMAP response is "OK"
|
||||
And mailbox "INBOX" for "user" has 0 messages
|
||||
And mailbox "Folders/mbox" for "user" has messages
|
||||
| from | to | subject |
|
||||
| john.doe@mail.com | user@pm.me | foo |
|
||||
| jane.doe@mail.com | name@pm.me | bar |
|
||||
| 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 |
|
||||
|
||||
@ -1,15 +1,20 @@
|
||||
Feature: IMAP delete messages
|
||||
Feature: IMAP remove messages from mailbox
|
||||
Background:
|
||||
Given there is connected user "user"
|
||||
And there is "user" with mailbox "Folders/mbox"
|
||||
And there is "user" with mailbox "Labels/label"
|
||||
|
||||
Scenario Outline: Delete message
|
||||
Scenario Outline: Mark message as deleted and EXPUNGE
|
||||
Given there are 10 messages in mailbox "<mailbox>" for "user"
|
||||
And there is IMAP client logged in as "user"
|
||||
And there is IMAP client selected in "<mailbox>"
|
||||
When IMAP client deletes messages "1"
|
||||
When IMAP client marks message "2" as deleted
|
||||
Then IMAP response is "OK"
|
||||
And mailbox "<mailbox>" for "user" has 10 messages
|
||||
And message "2" in "INBOX" for "user" is marked as deleted
|
||||
When IMAP client sends expunge
|
||||
Then IMAP response is "OK"
|
||||
And IMAP response contains "* 2 EXPUNGE"
|
||||
And mailbox "<mailbox>" for "user" has 9 messages
|
||||
|
||||
Examples:
|
||||
@ -17,14 +22,22 @@ Feature: IMAP delete messages
|
||||
| INBOX |
|
||||
| Folders/mbox |
|
||||
| Labels/label |
|
||||
| Spam |
|
||||
| Trash |
|
||||
|
||||
Scenario Outline: Delete all messages
|
||||
Given there are 10 messages in mailbox "<mailbox>" for "user"
|
||||
Scenario Outline: Mark all messages as deleted and EXPUNGE
|
||||
Given there are 5 messages in mailbox "<mailbox>" for "user"
|
||||
And there is IMAP client logged in as "user"
|
||||
And there is IMAP client selected in "<mailbox>"
|
||||
When IMAP client deletes messages "1:*"
|
||||
When IMAP client marks message "1:*" as deleted
|
||||
Then IMAP response is "OK"
|
||||
When IMAP client sends expunge
|
||||
Then IMAP response is "OK"
|
||||
And IMAP response contains "* 1 EXPUNGE"
|
||||
And IMAP response contains "* 2 EXPUNGE"
|
||||
And IMAP response contains "* 3 EXPUNGE"
|
||||
And IMAP response contains "* 4 EXPUNGE"
|
||||
And IMAP response contains "* 5 EXPUNGE"
|
||||
And mailbox "<mailbox>" for "user" has 0 messages
|
||||
|
||||
Examples:
|
||||
@ -32,14 +45,50 @@ Feature: IMAP delete messages
|
||||
| INBOX |
|
||||
| Folders/mbox |
|
||||
| Labels/label |
|
||||
| Spam |
|
||||
| Trash |
|
||||
|
||||
Scenario: Delete message by setting flags
|
||||
Given there are 1 messages in mailbox "INBOX" for "user"
|
||||
Scenario Outline: Mark messages as undeleted and EXPUNGE
|
||||
Given there are 5 messages in mailbox "<mailbox>" for "user"
|
||||
And there is IMAP client logged in as "user"
|
||||
And there is IMAP client selected in "<mailbox>"
|
||||
When IMAP client marks message "1:*" as deleted
|
||||
Then IMAP response is "OK"
|
||||
When IMAP client marks message "1:3" as undeleted
|
||||
Then IMAP response is "OK"
|
||||
When IMAP client sends expunge
|
||||
Then IMAP response is "OK"
|
||||
And IMAP response contains "* 4 EXPUNGE"
|
||||
And IMAP response contains "* 5 EXPUNGE"
|
||||
And mailbox "<mailbox>" for "user" has 3 messages
|
||||
|
||||
Examples:
|
||||
| mailbox |
|
||||
| INBOX |
|
||||
| Folders/mbox |
|
||||
| Labels/label |
|
||||
| Spam |
|
||||
| Trash |
|
||||
|
||||
Scenario Outline: Mark message as deleted and leave mailbox
|
||||
Given there are 10 messages in mailbox "INBOX" for "user"
|
||||
And there is IMAP client logged in as "user"
|
||||
And there is IMAP client selected in "INBOX"
|
||||
When IMAP client marks message "1" with "\Deleted"
|
||||
When IMAP client marks message "2" as deleted
|
||||
Then IMAP response is "OK"
|
||||
And mailbox "INBOX" for "user" has 0 messages
|
||||
# Unread because we set flags without \Seen.
|
||||
And message "1" in "Trash" for "user" is marked as unread
|
||||
And mailbox "INBOX" for "user" has 10 messages
|
||||
And message "2" in "INBOX" for "user" is marked as deleted
|
||||
When IMAP client sends command "<leave>"
|
||||
Then IMAP response is "OK"
|
||||
And mailbox "INBOX" for "user" has <n> messages
|
||||
|
||||
Examples:
|
||||
| leave | n |
|
||||
| CLOSE | 9 |
|
||||
| SELECT INBOX | 9 |
|
||||
| SELECT Trash | 9 |
|
||||
| EXAMINE INBOX | 9 |
|
||||
| EXAMINE Trash | 9 |
|
||||
| LOGOUT | 9 |
|
||||
| UNSELECT | 10 |
|
||||
|
||||
|
||||
@ -49,3 +49,14 @@ Feature: IMAP fetch messages
|
||||
When IMAP client fetches by UID "11:*"
|
||||
Then IMAP response is "OK"
|
||||
And IMAP response has 1 message
|
||||
|
||||
Scenario: Fetch returns also messages that are marked as deleted
|
||||
Given there are messages in mailbox "Folders/mbox" for "user"
|
||||
| from | to | subject | body | read | starred | deleted |
|
||||
| john.doe@mail.com | user@pm.me | foo | hello | false | false | false |
|
||||
| jane.doe@mail.com | name@pm.me | bar | world | true | true | true |
|
||||
And there is IMAP client logged in as "user"
|
||||
And there is IMAP client selected in "Folders/mbox"
|
||||
When IMAP client fetches by UID "1:*"
|
||||
Then IMAP response is "OK"
|
||||
And IMAP response has 2 message
|
||||
|
||||
@ -4,10 +4,10 @@ Feature: IMAP search messages
|
||||
# Messages are inserted in opposite way to keep increasing ID.
|
||||
# Sequence numbers are then opposite than listed above.
|
||||
Given there are messages in mailbox "INBOX" for "user"
|
||||
| from | to | cc | subject | read | starred | body |
|
||||
| john.doe@email.com | user@pm.me | | foo | false | false | hello |
|
||||
| jane.doe@email.com | user@pm.me | name@pm.me | bar | true | true | world |
|
||||
| jane.doe@email.com | name@pm.me | | baz | true | false | bye |
|
||||
| from | to | cc | subject | read | starred | deleted | body |
|
||||
| john.doe@email.com | user@pm.me | | foo | false | false | false | hello |
|
||||
| jane.doe@email.com | user@pm.me | name@pm.me | bar | true | true | false | world |
|
||||
| jane.doe@email.com | name@pm.me | | baz | true | false | true | bye |
|
||||
And there is IMAP client logged in as "user"
|
||||
And there is IMAP client selected in "INBOX"
|
||||
|
||||
@ -71,6 +71,16 @@ Feature: IMAP search messages
|
||||
Then IMAP response is "OK"
|
||||
And IMAP response contains "SEARCH 3[^0-9]*$"
|
||||
|
||||
Scenario: Search deleted messages
|
||||
When IMAP client searches for "DELETED"
|
||||
Then IMAP response is "OK"
|
||||
And IMAP response contains "SEARCH 1 2[^0-9]*$"
|
||||
|
||||
Scenario: Search undeleted messages
|
||||
When IMAP client searches for "UNDELETED"
|
||||
Then IMAP response is "OK"
|
||||
And IMAP response contains "SEARCH 3[^0-9]*$"
|
||||
|
||||
Scenario: Search recent messages
|
||||
When IMAP client searches for "RECENT"
|
||||
Then IMAP response is "OK"
|
||||
|
||||
@ -4,9 +4,9 @@ Feature: IMAP update messages
|
||||
# Messages are inserted in opposite way to keep increasing ID.
|
||||
# Sequence numbers are then opposite than listed above.
|
||||
And there are messages in mailbox "INBOX" for "user"
|
||||
| from | to | subject | body | read | starred |
|
||||
| john.doe@mail.com | user@pm.me | foo | hello | false | false |
|
||||
| jane.doe@mail.com | name@pm.me | bar | world | true | true |
|
||||
| from | to | subject | body | read | starred | deleted |
|
||||
| john.doe@mail.com | user@pm.me | foo | hello | false | false | false |
|
||||
| jane.doe@mail.com | name@pm.me | bar | world | true | true | false |
|
||||
And there is IMAP client logged in as "user"
|
||||
And there is IMAP client selected in "INBOX"
|
||||
|
||||
@ -55,3 +55,25 @@ Feature: IMAP update messages
|
||||
# Unread and unstarred because we set flags without \Seen and \Starred.
|
||||
And message "1" in "Spam" for "user" is marked as unread
|
||||
And message "1" in "Spam" for "user" is marked as unstarred
|
||||
|
||||
Scenario: Mark message as deleted
|
||||
When IMAP client marks message "2" as deleted
|
||||
Then IMAP response is "OK"
|
||||
And message "2" in "INBOX" for "user" is marked as read
|
||||
And message "2" in "INBOX" for "user" is marked as starred
|
||||
And message "2" in "INBOX" for "user" is marked as deleted
|
||||
|
||||
Scenario: Mark message as undeleted
|
||||
When IMAP client marks message "2" as undeleted
|
||||
Then IMAP response is "OK"
|
||||
And message "2" in "INBOX" for "user" is marked as read
|
||||
And message "2" in "INBOX" for "user" is marked as starred
|
||||
And message "2" in "INBOX" for "user" is marked as undeleted
|
||||
|
||||
Scenario: Mark message as deleted only
|
||||
When IMAP client marks message "2" with "\Deleted"
|
||||
Then IMAP response is "OK"
|
||||
And message "2" in "INBOX" for "user" is marked as unread
|
||||
And message "2" in "INBOX" for "user" is marked as unstarred
|
||||
And message "2" in "INBOX" for "user" is marked as undeleted
|
||||
|
||||
|
||||
Reference in New Issue
Block a user