Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
deff7 authored and requilence committed Feb 19, 2025
1 parent c1c7a9b commit b030815
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
16 changes: 14 additions & 2 deletions core/files/fileobject/fileindex_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"
"testing"

"github.com/anyproto/any-sync/app"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

Expand All @@ -23,13 +24,24 @@ type indexerFixture struct {
objectStoreFixture *objectstore.StoreFixture
}

type dummyAccountService struct{}

func (s dummyAccountService) MyParticipantId(spaceId string) string {
return ""
}

func (s dummyAccountService) Init(_ *app.App) error { return nil }

func (s dummyAccountService) Name() string { return "dummyAccountService" }

func newIndexerFixture(t *testing.T) *indexerFixture {
objectStore := objectstore.NewStoreFixture(t)
fileService := mock_files.NewMockService(t)

svc := &service{
objectStore: objectStore,
fileService: fileService,
objectStore: objectStore,
fileService: fileService,
accountService: &dummyAccountService{},
}
ind := svc.newIndexer()

Expand Down
1 change: 1 addition & 0 deletions core/files/fileobject/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ func newFixture(t *testing.T) *fixture {
a.Register(testutil.PrepareMock(ctx, a, wallet))
a.Register(&config.Config{DisableFileConfig: true, NetworkMode: pb.RpcAccount_DefaultConfig, PeferYamuxTransport: true})
a.Register(&dummyObjectArchiver{})
a.Register(&dummyAccountService{})

err = a.Start(ctx)
require.NoError(t, err)
Expand Down

0 comments on commit b030815

Please sign in to comment.