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,
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)
require.NoError(t, err)

View File

@ -3,6 +3,8 @@ package protocol
import (
"context"
"crypto/ecdsa"
"github.com/status-im/status-go/multiaccounts"
"io/ioutil"
"testing"
"github.com/google/uuid"
@ -53,10 +55,16 @@ func (s *MessengerEmojiSuite) TearDownTest() {
}
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{
WithCustomLogger(s.logger),
WithMessagesPersistenceEnabled(),
WithDatabaseConfig(sqlite.InMemoryPath, "some-key"),
WithMultiAccounts(madb),
WithDatasync(),
}
installationID := uuid.New().String()