Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
deff7 committed Aug 26, 2024
1 parent c6dcc9d commit a7829d5
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions core/files/fileobject/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import (
"github.com/anyproto/anytype-heart/core/filestorage"
"github.com/anyproto/anytype-heart/core/filestorage/filesync"
"github.com/anyproto/anytype-heart/core/filestorage/rpcstore"
"github.com/anyproto/anytype-heart/core/session"
wallet2 "github.com/anyproto/anytype-heart/core/wallet"
"github.com/anyproto/anytype-heart/core/wallet/mock_wallet"
"github.com/anyproto/anytype-heart/pb"
Expand Down Expand Up @@ -68,6 +69,16 @@ func (c *dummyConfig) Name() string {
return "dummyConfig"
}

type dummyObjectArchiver struct{}

func (a *dummyObjectArchiver) SetPagesIsArchived(ctx session.Context, req pb.RpcObjectListSetIsArchivedRequest) error {
return nil
}

func (a *dummyObjectArchiver) Name() string { return "dummyObjectArchiver" }

func (a *dummyObjectArchiver) Init(_ *app.App) error { return nil }

const testResolveRetryDelay = 5 * time.Millisecond

func newFixture(t *testing.T) *fixture {
Expand All @@ -85,6 +96,7 @@ func newFixture(t *testing.T) *fixture {
eventSender.EXPECT().Broadcast(mock.Anything).Return().Maybe()
fileService := files.New()
spaceService := mock_space.NewMockService(t)
spaceService.EXPECT().GetPersonalSpace(mock.Anything).Return(nil, fmt.Errorf("not needed")).Maybe()
spaceIdResolver := mock_idresolver.NewMockResolver(t)

svc := New(testResolveRetryDelay, testResolveRetryDelay)
Expand Down Expand Up @@ -114,6 +126,7 @@ func newFixture(t *testing.T) *fixture {
a.Register(testutil.PrepareMock(ctx, a, mock_accountservice.NewMockService(ctrl)))
a.Register(testutil.PrepareMock(ctx, a, wallet))
a.Register(&config.Config{DisableFileConfig: true, NetworkMode: pb.RpcAccount_DefaultConfig, PeferYamuxTransport: true})
a.Register(&dummyObjectArchiver{})

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

0 comments on commit a7829d5

Please sign in to comment.