Fix failing tests

This commit is contained in:
Samuel Hawksby-Robinson 2020-11-26 16:49:57 +00:00 committed by Andrea Maria Piana
parent 32907b59b2
commit 5aa8492315
2 changed files with 9 additions and 1 deletions

View File

@ -63,7 +63,7 @@ func TestIdentityImage_MarshalJSON(t *testing.T) {
FileSize: 256, FileSize: 256,
ResizeTarget: 80, ResizeTarget: 80,
} }
expected := `{"type":"thumbnail","uri":"data:image/jpeg;base64,/9j/2wCEAFA3PEY8MlA=","width":80,"height":80,"file_size":256,"resize_target":80}` expected := `{"key_uid":"","type":"thumbnail","uri":"data:image/jpeg;base64,/9j/2wCEAFA3PEY8MlA=","width":80,"height":80,"file_size":256,"resize_target":80}`
js, err := json.Marshal(ii) js, err := json.Marshal(ii)
require.NoError(t, err) require.NoError(t, err)

View File

@ -3,6 +3,8 @@ package protocol
import ( import (
"context" "context"
"crypto/ecdsa" "crypto/ecdsa"
"github.com/status-im/status-go/multiaccounts"
"io/ioutil"
"testing" "testing"
"github.com/google/uuid" "github.com/google/uuid"
@ -53,10 +55,16 @@ func (s *MessengerEmojiSuite) TearDownTest() {
} }
func (s *MessengerEmojiSuite) newMessengerWithKey(shh types.Waku, privateKey *ecdsa.PrivateKey) *Messenger { func (s *MessengerEmojiSuite) newMessengerWithKey(shh types.Waku, privateKey *ecdsa.PrivateKey) *Messenger {
tmpfile, err := ioutil.TempFile("", "accounts-tests-")
s.Require().NoError(err)
madb, err := multiaccounts.InitializeDB(tmpfile.Name())
s.Require().NoError(err)
options := []Option{ options := []Option{
WithCustomLogger(s.logger), WithCustomLogger(s.logger),
WithMessagesPersistenceEnabled(), WithMessagesPersistenceEnabled(),
WithDatabaseConfig(sqlite.InMemoryPath, "some-key"), WithDatabaseConfig(sqlite.InMemoryPath, "some-key"),
WithMultiAccounts(madb),
WithDatasync(), WithDatasync(),
} }
installationID := uuid.New().String() installationID := uuid.New().String()