Resolved broken tests
This commit is contained in:
parent
829108c96f
commit
ca80140c1a
|
@ -63,7 +63,7 @@ func TestIdentityImage_MarshalJSON(t *testing.T) {
|
||||||
FileSize: 256,
|
FileSize: 256,
|
||||||
ResizeTarget: 80,
|
ResizeTarget: 80,
|
||||||
}
|
}
|
||||||
expected := `{"key_uid":"","type":"thumbnail","uri":"data:image/jpeg;base64,/9j/2wCEAFA3PEY8MlA=","width":80,"height":80,"file_size":256,"resize_target":80}`
|
expected := `{"keyUid":"","type":"thumbnail","uri":"data:image/jpeg;base64,/9j/2wCEAFA3PEY8MlA=","width":80,"height":80,"fileSize":256,"resizeTarget":80}`
|
||||||
|
|
||||||
js, err := json.Marshal(ii)
|
js, err := json.Marshal(ii)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
|
@ -91,6 +91,7 @@ func (s *MessengerEmojiSuite) newMessenger(shh types.Waku) *Messenger {
|
||||||
|
|
||||||
func (s *MessengerEmojiSuite) TestSendEmoji() {
|
func (s *MessengerEmojiSuite) TestSendEmoji() {
|
||||||
alice := s.m
|
alice := s.m
|
||||||
|
alice.account = &multiaccounts.Account{KeyUID: "0xdeadbeef"}
|
||||||
key, err := crypto.GenerateKey()
|
key, err := crypto.GenerateKey()
|
||||||
s.Require().NoError(err)
|
s.Require().NoError(err)
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,7 @@ import (
|
||||||
gomock "github.com/golang/mock/gomock"
|
gomock "github.com/golang/mock/gomock"
|
||||||
|
|
||||||
account "github.com/status-im/status-go/account"
|
account "github.com/status-im/status-go/account"
|
||||||
|
"github.com/status-im/status-go/account/generator"
|
||||||
types "github.com/status-im/status-go/eth-node/types"
|
types "github.com/status-im/status-go/eth-node/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -106,13 +107,14 @@ func (mr *MockAccountManagerMockRecorder) SelectAccount(arg0 interface{}) *gomoc
|
||||||
}
|
}
|
||||||
|
|
||||||
// CreateAccount mocks base method
|
// CreateAccount mocks base method
|
||||||
func (m *MockAccountManager) CreateAccount(password string) (account.Info, string, error) {
|
func (m *MockAccountManager) CreateAccount(password string) (generator.GeneratedAccountInfo, account.Info, string, error) {
|
||||||
m.ctrl.T.Helper()
|
m.ctrl.T.Helper()
|
||||||
ret := m.ctrl.Call(m, "CreateAccount", password)
|
ret := m.ctrl.Call(m, "CreateAccount", password)
|
||||||
ret0, _ := ret[0].(account.Info)
|
ret0, _ := ret[0].(generator.GeneratedAccountInfo)
|
||||||
ret1, _ := ret[1].(string)
|
ret1, _ := ret[1].(account.Info)
|
||||||
ret2, _ := ret[2].(error)
|
ret2, _ := ret[2].(string)
|
||||||
return ret0, ret1, ret2
|
ret3, _ := ret[3].(error)
|
||||||
|
return ret0, ret1, ret2, ret3
|
||||||
}
|
}
|
||||||
|
|
||||||
// CreateAccount indicates an expected call of CreateAccount
|
// CreateAccount indicates an expected call of CreateAccount
|
||||||
|
|
|
@ -4,6 +4,7 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"crypto/ecdsa"
|
"crypto/ecdsa"
|
||||||
"errors"
|
"errors"
|
||||||
|
"github.com/status-im/status-go/account/generator"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/golang/mock/gomock"
|
"github.com/golang/mock/gomock"
|
||||||
|
@ -131,13 +132,17 @@ var signuptests = []struct {
|
||||||
},
|
},
|
||||||
expectedError: nil,
|
expectedError: nil,
|
||||||
prepareExpectations: func(s *StatusSuite) {
|
prepareExpectations: func(s *StatusSuite) {
|
||||||
|
mKInfo := generator.GeneratedAccountInfo{
|
||||||
|
IdentifiedAccountInfo: generator.IdentifiedAccountInfo{},
|
||||||
|
Mnemonic: "",
|
||||||
|
}
|
||||||
accountInfo := account.Info{
|
accountInfo := account.Info{
|
||||||
WalletAddress: "addr",
|
WalletAddress: "addr",
|
||||||
WalletPubKey: "pubkey",
|
WalletPubKey: "pubkey",
|
||||||
ChatAddress: "addr",
|
ChatAddress: "addr",
|
||||||
ChatPubKey: "pubkey",
|
ChatPubKey: "pubkey",
|
||||||
}
|
}
|
||||||
s.am.EXPECT().CreateAccount("password").Return(accountInfo, "mnemonic", nil)
|
s.am.EXPECT().CreateAccount("password").Return(mKInfo, accountInfo, "mnemonic", nil)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -149,7 +154,11 @@ var signuptests = []struct {
|
||||||
},
|
},
|
||||||
expectedError: errors.New("could not create the specified account : foo"),
|
expectedError: errors.New("could not create the specified account : foo"),
|
||||||
prepareExpectations: func(s *StatusSuite) {
|
prepareExpectations: func(s *StatusSuite) {
|
||||||
s.am.EXPECT().CreateAccount("password").Return(account.Info{}, "", errors.New("foo"))
|
mKInfo := generator.GeneratedAccountInfo{
|
||||||
|
IdentifiedAccountInfo: generator.IdentifiedAccountInfo{},
|
||||||
|
Mnemonic: "",
|
||||||
|
}
|
||||||
|
s.am.EXPECT().CreateAccount("password").Return(mKInfo, account.Info{}, "", errors.New("foo"))
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue