mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-24 10:56:43 +00:00
Other: Match any case in IMAP/SMTP auth, with test
This commit is contained in:
@ -140,6 +140,7 @@ func TestFeatures(testingT *testing.T) {
|
||||
ctx.Step(`^user "([^"]*)" connects and authenticates IMAP client "([^"]*)"$`, s.userConnectsAndAuthenticatesIMAPClient)
|
||||
ctx.Step(`^user "([^"]*)" connects and authenticates IMAP client "([^"]*)" with address "([^"]*)"$`, s.userConnectsAndAuthenticatesIMAPClientWithAddress)
|
||||
ctx.Step(`^IMAP client "([^"]*)" can authenticate$`, s.imapClientCanAuthenticate)
|
||||
ctx.Step(`^IMAP client "([^"]*)" can authenticate with address "([^"]*)"$`, s.imapClientCanAuthenticateWithAddress)
|
||||
ctx.Step(`^IMAP client "([^"]*)" cannot authenticate$`, s.imapClientCannotAuthenticate)
|
||||
ctx.Step(`^IMAP client "([^"]*)" cannot authenticate with address "([^"]*)"$`, s.imapClientCannotAuthenticateWithAddress)
|
||||
ctx.Step(`^IMAP client "([^"]*)" cannot authenticate with incorrect username$`, s.imapClientCannotAuthenticateWithIncorrectUsername)
|
||||
|
||||
@ -8,6 +8,14 @@ Feature: A user can authenticate an IMAP client
|
||||
When user "user@pm.me" connects IMAP client "1"
|
||||
Then IMAP client "1" can authenticate
|
||||
|
||||
Scenario: IMAP client can authenticate successfully with different case
|
||||
When user "user@pm.me" connects IMAP client "1"
|
||||
Then IMAP client "1" can authenticate with address "USER@PM.ME"
|
||||
|
||||
Scenario: IMAP client can authenticate successfully
|
||||
When user "user@pm.me" connects IMAP client "1"
|
||||
Then IMAP client "1" can authenticate
|
||||
|
||||
Scenario: IMAP client cannot authenticate with bad username
|
||||
When user "user@pm.me" connects IMAP client "1"
|
||||
Then IMAP client "1" cannot authenticate with incorrect username
|
||||
@ -19,4 +27,4 @@ Feature: A user can authenticate an IMAP client
|
||||
Scenario: IMAP client cannot authenticate for disconnected user
|
||||
When user "user@pm.me" logs out
|
||||
And user "user@pm.me" connects IMAP client "1"
|
||||
Then IMAP client "1" cannot authenticate
|
||||
Then IMAP client "1" cannot authenticate
|
||||
|
||||
@ -45,6 +45,12 @@ func (s *scenario) imapClientCanAuthenticate(clientID string) error {
|
||||
return client.Login(s.t.getUserAddrs(userID)[0], s.t.getUserBridgePass(userID))
|
||||
}
|
||||
|
||||
func (s *scenario) imapClientCanAuthenticateWithAddress(clientID string, address string) error {
|
||||
userID, client := s.t.getIMAPClient(clientID)
|
||||
|
||||
return client.Login(address, s.t.getUserBridgePass(userID))
|
||||
}
|
||||
|
||||
func (s *scenario) imapClientCannotAuthenticate(clientID string) error {
|
||||
userID, client := s.t.getIMAPClient(clientID)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user