mirror of
https://github.com/anyproto/anytype-heart.git
synced 2025-06-11 10:18:28 +09:00
GO-3631 Fix space service tests
This commit is contained in:
parent
ce35860bc8
commit
406ac75b38
3 changed files with 2846 additions and 6 deletions
|
@ -64,7 +64,7 @@ func TestService_Init(t *testing.T) {
|
|||
ctx2, ctxCancel2 := context.WithTimeout(context.Background(), time.Millisecond)
|
||||
defer ctxCancel2()
|
||||
|
||||
factory.EXPECT().CreateAndSetTechSpace(ctx2).Return(&clientspace.TechSpace{}, nil)
|
||||
factory.EXPECT().LoadAndSetTechSpace(ctx2).Return(&clientspace.TechSpace{}, nil)
|
||||
require.NoError(t, serv.loadTechSpace(ctx2))
|
||||
|
||||
s, err := serv.Get(ctx2, serv.techSpaceId)
|
||||
|
@ -240,12 +240,12 @@ func TestService_UpdateSharedLimits(t *testing.T) {
|
|||
personalSpaceId: "spaceId",
|
||||
techSpace: &clientspace.TechSpace{TechSpace: mockTechSpace},
|
||||
}
|
||||
mockSpaceView := mock_techspace.NewMockSpaceView(t)
|
||||
mockTechSpace.EXPECT().DoSpaceView(ctx, "spaceId", mock.Anything).RunAndReturn(
|
||||
func(ctx context.Context, spaceId string, f func(view techspace.SpaceView) error) error {
|
||||
return f(mockSpaceView)
|
||||
mockAccountObject := mock_techspace.NewMockAccountObject(t)
|
||||
mockTechSpace.EXPECT().DoAccountObject(ctx, mock.Anything).RunAndReturn(
|
||||
func(ctx context.Context, f func(view techspace.AccountObject) error) error {
|
||||
return f(mockAccountObject)
|
||||
})
|
||||
mockSpaceView.EXPECT().SetSharedSpacesLimit(10).Return(nil)
|
||||
mockAccountObject.EXPECT().SetSharedSpacesLimit(10).Return(nil)
|
||||
|
||||
// when
|
||||
err := s.UpdateSharedLimits(ctx, 10)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue