GODT-1742: Implement hide All Mail

This commit is contained in:
Leander Beernaert
2022-10-20 14:38:42 +02:00
committed by James Houlahan
parent 395e7b54f6
commit a7a7d9a3d4
8 changed files with 88 additions and 5 deletions

View File

@ -122,6 +122,8 @@ func TestFeatures(testingT *testing.T) {
ctx.Step(`^bridge sends an update installed event for version "([^"]*)"$`, s.bridgeSendsAnUpdateInstalledEventForVersion)
ctx.Step(`^bridge sends an update not available event$`, s.bridgeSendsAnUpdateNotAvailableEvent)
ctx.Step(`^bridge sends a forced update event$`, s.bridgeSendsAForcedUpdateEvent)
ctx.Step(`^bridge hides all mail$`, s.bridgeHidesAllMail)
ctx.Step(`^bridge shows all mail$`, s.bridgeShowsAllMail)
// ==== USER ====
ctx.Step(`^the user logs in with username "([^"]*)" and password "([^"]*)"$`, s.userLogsInWithUsernameAndPassword)

View File

@ -267,6 +267,14 @@ func (s *scenario) bridgeSendsAForcedUpdateEvent() error {
})
}
func (s *scenario) bridgeHidesAllMail() error {
return s.t.bridge.SetShowAllMail(false)
}
func (s *scenario) bridgeShowsAllMail() error {
return s.t.bridge.SetShowAllMail(true)
}
func try[T any](inCh *queue.QueuedChannel[T], wait time.Duration, fn func(T) error) error {
select {
case event := <-inCh.GetChannel():

View File

@ -0,0 +1,46 @@
Feature: IMAP Hide All Mail
Background:
Given there exists an account with username "user@pm.me" and password "password"
And bridge starts
And the user logs in with username "user@pm.me" and password "password"
And user "user@pm.me" finishes syncing
And user "user@pm.me" connects and authenticates IMAP client "1"
Scenario: Hide All Mail Mailbox
Given IMAP client "1" sees the following mailbox info:
| name | total | unread |
| INBOX | 0 | 0 |
| Drafts | 0 | 0 |
| Sent | 0 | 0 |
| Starred | 0 | 0 |
| Archive | 0 | 0 |
| Spam | 0 | 0 |
| Trash | 0 | 0 |
| All Mail | 0 | 0 |
| Folders | 0 | 0 |
| Labels | 0 | 0 |
When bridge hides all mail
Then IMAP client "1" sees the following mailbox info:
| name | total | unread |
| INBOX | 0 | 0 |
| Drafts | 0 | 0 |
| Sent | 0 | 0 |
| Starred | 0 | 0 |
| Archive | 0 | 0 |
| Spam | 0 | 0 |
| Trash | 0 | 0 |
| Folders | 0 | 0 |
| Labels | 0 | 0 |
When bridge shows all mail
Then IMAP client "1" sees the following mailbox info:
| name | total | unread |
| INBOX | 0 | 0 |
| Drafts | 0 | 0 |
| Sent | 0 | 0 |
| Starred | 0 | 0 |
| Archive | 0 | 0 |
| Spam | 0 | 0 |
| Trash | 0 | 0 |
| All Mail | 0 | 0 |
| Folders | 0 | 0 |
| Labels | 0 | 0 |