Fix failing tests
This commit is contained in:
parent
32907b59b2
commit
5aa8492315
|
@ -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)
|
||||||
|
|
|
@ -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()
|
||||||
|
|
Loading…
Reference in New Issue