1
0
Fork 0
mirror of https://github.com/anyproto/anytype-heart.git synced 2025-06-09 17:44:59 +09:00

GO-3631 Fix comments

This commit is contained in:
mcrakhman 2024-10-08 10:58:24 +02:00
parent f86c535aac
commit 516722c90f
No known key found for this signature in database
GPG key ID: DED12CFEF5B8396B
5 changed files with 31 additions and 67 deletions

View file

@ -73,18 +73,16 @@ func TestService_Init(t *testing.T) {
assert.NotNil(t, s)
})
t.Run("new account", func(t *testing.T) {
fx := newFixture(t, nil)
defer fx.finish(t)
newFixture(t, nil)
})
t.Run("old account", func(t *testing.T) {
fx := newFixture(t, func(t *testing.T, fx *fixture) {
newFixture(t, func(t *testing.T, fx *fixture) {
fx.factory.EXPECT().LoadAndSetTechSpace(mock.Anything).Return(&clientspace.TechSpace{TechSpace: fx.techSpace}, nil)
fx.techSpace.EXPECT().WakeUpViews()
})
defer fx.finish(t)
})
t.Run("very old account without tech space", func(t *testing.T) {
fx := newFixture(t, func(t *testing.T, fx *fixture) {
newFixture(t, func(t *testing.T, fx *fixture) {
fx.factory.EXPECT().LoadAndSetTechSpace(mock.Anything).Return(nil, spacesyncproto.ErrSpaceMissing)
fx.spaceCore.EXPECT().Get(mock.Anything, fx.spaceId).Return(nil, nil)
fx.factory.EXPECT().CreateAndSetTechSpace(mock.Anything).Return(&clientspace.TechSpace{TechSpace: fx.techSpace}, nil)
@ -93,7 +91,6 @@ func TestService_Init(t *testing.T) {
prCtrl.EXPECT().Close(mock.Anything).Return(nil)
fx.techSpace.EXPECT().WakeUpViews()
})
defer fx.finish(t)
})
}
@ -308,7 +305,9 @@ func newFixture(t *testing.T, expectOldAccount func(t *testing.T, fx *fixture))
fx.expectRun(t, expectOldAccount)
require.NoError(t, fx.a.Start(ctx))
t.Cleanup(func() {
require.NoError(t, fx.a.Close(ctx))
})
return fx
}