Fixing unit tests for client manager.

* [x] pmapi: refresh auth uid won't change
* [x] bridge tests:
    * update mocks
    * delete auth when FinishLogin fails
    * check for mailbox password
    * add `gomock.InOrder` for better test control
* [x] fix linter issues except TODOs
* [x] make rootScheme unexported
* [x] store tests: update mocks
This commit is contained in:
Jakub
2020-04-14 07:54:11 +02:00
committed by James Houlahan
parent debd374d75
commit 80f4e1e346
25 changed files with 537 additions and 364 deletions

View File

@ -33,8 +33,6 @@ import (
r "github.com/stretchr/testify/require"
)
var aLongTimeAgo = time.Unix(233431200, 0)
var testIdentity = &pmcrypto.Identity{
Name: "UserID",
Email: "",
@ -276,10 +274,11 @@ func TestClient_AuthRefresh(t *testing.T) {
auth, err := c.AuthRefresh(testUID + ":" + testRefreshToken)
Ok(t, err)
Equals(t, testUID, c.uid)
exp := &Auth{}
*exp = *testAuth
exp.uid = "" // AuthRefresh will not return UID (only Auth returns the UID).
exp.uid = testUID // AuthRefresh will not return UID (only Auth returns the UID) we should set testUID to be able to generate token, see `GetToken`
exp.accessToken = testAccessToken
exp.KeySalt = ""
exp.EventID = ""