Lint, test fixes
Этот коммит содержится в:
@@ -3078,15 +3078,15 @@ func TestGetTopDMsForUserSince(t *testing.T) {
|
||||
u3 := th.CreateUser()
|
||||
u4 := th.CreateUser()
|
||||
// user direct messages
|
||||
chUser1, nErr := th.App.createDirectChannel(u1.Id, user.Id)
|
||||
chUser1, nErr := th.App.createDirectChannel(th.Context, u1.Id, user.Id)
|
||||
fmt.Println(chUser1, nErr)
|
||||
require.Nil(t, nErr)
|
||||
chUser2, nErr := th.App.createDirectChannel(u2.Id, user.Id)
|
||||
chUser2, nErr := th.App.createDirectChannel(th.Context, u2.Id, user.Id)
|
||||
require.Nil(t, nErr)
|
||||
chUser3, nErr := th.App.createDirectChannel(u3.Id, user.Id)
|
||||
chUser3, nErr := th.App.createDirectChannel(th.Context, u3.Id, user.Id)
|
||||
require.Nil(t, nErr)
|
||||
// other user direct message
|
||||
chUser3User4, nErr := th.App.createDirectChannel(u3.Id, u4.Id)
|
||||
chUser3User4, nErr := th.App.createDirectChannel(th.Context, u3.Id, u4.Id)
|
||||
require.Nil(t, nErr)
|
||||
|
||||
// sample post data
|
||||
|
||||
@@ -3930,8 +3930,8 @@ func testGetTopDMsForUserSince(t *testing.T, ss store.Store, s SqlStore) {
|
||||
})
|
||||
require.NoError(t, err)
|
||||
t.Run("should return topDMs when userid is specified ", func(t *testing.T) {
|
||||
topDMs, err := ss.Post().GetTopDMsForUserSince(user.Id, 100, 0, 100)
|
||||
require.NoError(t, err)
|
||||
topDMs, storeErr := ss.Post().GetTopDMsForUserSince(user.Id, 100, 0, 100)
|
||||
require.NoError(t, storeErr)
|
||||
// len of topDMs.Items should be 3
|
||||
require.Len(t, topDMs.Items, 3)
|
||||
// check order, magnitude of items
|
||||
@@ -3946,8 +3946,8 @@ func testGetTopDMsForUserSince(t *testing.T, ss store.Store, s SqlStore) {
|
||||
})
|
||||
t.Run("topDMs should only consider user's DM channels ", func(t *testing.T) {
|
||||
// u4 only takes part in one conversation
|
||||
topDMs, err := ss.Post().GetTopDMsForUserSince(u4.Id, 100, 0, 100)
|
||||
require.NoError(t, err)
|
||||
topDMs, storeErr := ss.Post().GetTopDMsForUserSince(u4.Id, 100, 0, 100)
|
||||
require.NoError(t, storeErr)
|
||||
// len of topDMs.Items should be 3
|
||||
require.Len(t, topDMs.Items, 1)
|
||||
// check order, magnitude of items
|
||||
|
||||
Ссылка в новой задаче
Block a user