From 8e6f294fbde06a3b3689d3c613d51aaca631efdd Mon Sep 17 00:00:00 2001 From: Shivashis Padhi Date: Thu, 21 Jul 2022 18:49:46 +0530 Subject: [PATCH] Lint, test fixes --- app/post_test.go | 8 ++++---- store/storetest/post_store.go | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/post_test.go b/app/post_test.go index 81f7dcdd11..c18bf2a9dc 100644 --- a/app/post_test.go +++ b/app/post_test.go @@ -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 diff --git a/store/storetest/post_store.go b/store/storetest/post_store.go index 33984b58a4..84707d599e 100644 --- a/store/storetest/post_store.go +++ b/store/storetest/post_store.go @@ -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