GODT-1415: Only messages which are in Spam should be moved to INBOX once they are marked as not-a-spam.

This is regression of GODT-963
This commit is contained in:
Jakub
2021-11-08 13:03:30 +01:00
committed by Jakub Cuth
parent 9d405a1549
commit cea33bebe2
3 changed files with 51 additions and 13 deletions

View File

@ -30,7 +30,16 @@ func (api *FakePMAPI) isLabelFolder(labelID string) bool {
return bool(label.Exclusive)
}
}
return labelID == pmapi.InboxLabel || labelID == pmapi.ArchiveLabel || labelID == pmapi.SentLabel
switch labelID {
case pmapi.InboxLabel,
pmapi.TrashLabel,
pmapi.SpamLabel,
pmapi.ArchiveLabel,
pmapi.SentLabel,
pmapi.DraftLabel:
return true
}
return false
}
func (api *FakePMAPI) ListLabels(context.Context) ([]*pmapi.Label, error) {

View File

@ -20,7 +20,7 @@ Feature: IMAP update messages in Spam folder
| john.doe@mail.com | user@pm.me | foo |
| jane.doe@mail.com | name@pm.me | bar |
Scenario Outline: Removing flag "junk" or adding flags "nojunk" moves message to INBOX
Scenario Outline: Move from Spam to INBOX when client <operation> <flag>
When IMAP client <operation> flags "<flag>" <suffix> message seq "1"
Then IMAP response is "OK"
And mailbox "INBOX" for "user" has 1 messages
@ -38,3 +38,25 @@ Feature: IMAP update messages in Spam folder
| removes | from | junk |
| removes | from | Junk |
| removes | from | $Junk |
Scenario Outline: Do not move from Archive to INBOX when client <operation> <flag>
Given there are messages in mailbox "Archive" for "user"
| id | from | to | subject | body | read | starred | deleted |
| 1 | john.doe@mail.com | user@pm.me | Archived | hello | false | false | false |
And there is IMAP client selected in "Archive"
When IMAP client <operation> flags "<flag>" <suffix> message seq "1"
Then IMAP response is "OK"
And mailbox "INBOX" for "user" has 0 messages
And mailbox "Archive" for "user" has 1 messages
And mailbox "Archive" for "user" has messages
| from | to | subject |
| john.doe@mail.com | user@pm.me | Archived |
Examples:
| operation | suffix | flag |
| adds | to | nojunk |
| adds | to | NoJunk |
| removes | from | junk |
| removes | from | Junk |
| removes | from | $Junk |