GODT-2003: introduces 3 phases user state (SignedOut/Locked/Connected)

WIP: introduced UserState enum in GUI and implemented logic.
This commit is contained in:
Xavier Michelon
2022-11-15 17:24:54 +01:00
parent 49b3c18903
commit e087a7972e
27 changed files with 1516 additions and 1276 deletions

View File

@ -24,6 +24,7 @@ import (
"net/mail"
"github.com/ProtonMail/gopenpgp/v2/crypto"
"github.com/ProtonMail/proton-bridge/v2/internal/bridge"
"github.com/bradenaw/juniper/iterator"
"github.com/bradenaw/juniper/xslices"
"github.com/cucumber/godog"
@ -306,7 +307,7 @@ func (s *scenario) userIsListedAndConnected(username string) error {
return errors.New("user not listed")
}
if !user.Connected {
if user.State != bridge.Connected {
return errors.New("user not connected")
}
@ -329,7 +330,7 @@ func (s *scenario) userIsListedButNotConnected(username string) error {
return errors.New("user not listed")
}
if user.Connected {
if user.State == bridge.Connected {
return errors.New("user connected")
}