[GH-28353] Fix errcheck issues in server/channels/api4/channel_bookmark_test.go (#28358)

Этот коммит содержится в:
CarlssonFilip
2024-10-01 13:02:56 +02:00
коммит произвёл GitHub
родитель 076a3cb0d5
Коммит c5a504883d
2 изменённых файлов: 12 добавлений и 7 удалений

Просмотреть файл

@@ -64,7 +64,6 @@ issues:
channels/api4/brand.go|\
channels/api4/brand_test.go|\
channels/api4/channel.go|\
channels/api4/channel_bookmark_test.go|\
channels/api4/channel_category.go|\
channels/api4/channel_test.go|\
channels/api4/cloud.go|\

Просмотреть файл

@@ -22,7 +22,8 @@ func TestCreateChannelBookmark(t *testing.T) {
th := Setup(t).InitBasic()
defer th.TearDown()
th.App.SetPhase2PermissionsMigrationStatus(true)
err := th.App.SetPhase2PermissionsMigrationStatus(true)
require.NoError(t, err)
t.Run("should not work without a license", func(t *testing.T) {
channelBookmark := &model.ChannelBookmark{
@@ -268,7 +269,8 @@ func TestEditChannelBookmark(t *testing.T) {
th := Setup(t).InitBasic()
defer th.TearDown()
th.App.SetPhase2PermissionsMigrationStatus(true)
err := th.App.SetPhase2PermissionsMigrationStatus(true)
require.NoError(t, err)
t.Run("should not work without a license", func(t *testing.T) {
_, _, err := th.Client.UpdateChannelBookmark(context.Background(), th.BasicChannel.Id, model.NewId(), &model.ChannelBookmarkPatch{})
@@ -646,7 +648,8 @@ func TestUpdateChannelBookmarkSortOrder(t *testing.T) {
th := Setup(t).InitBasic()
defer th.TearDown()
th.App.SetPhase2PermissionsMigrationStatus(true)
err := th.App.SetPhase2PermissionsMigrationStatus(true)
require.NoError(t, err)
createBookmark := func(name, channelId string) *model.ChannelBookmarkWithFileInfo {
b := &model.ChannelBookmark{
@@ -780,7 +783,8 @@ func TestUpdateChannelBookmarkSortOrder(t *testing.T) {
originalBookmark, appErr := th.App.GetBookmark(tc.bookmarkId, false)
require.Nil(t, appErr)
defer func() {
th.App.UpdateChannelBookmarkSortOrder(originalBookmark.Id, originalBookmark.ChannelId, originalBookmark.SortOrder, "")
_, err := th.App.UpdateChannelBookmarkSortOrder(originalBookmark.Id, originalBookmark.ChannelId, originalBookmark.SortOrder, "")
require.Nil(t, err)
}()
bookmarks, resp, err := tc.userClient.UpdateChannelBookmarkSortOrder(context.Background(), tc.channelId, tc.bookmarkId, tc.sortOrder)
@@ -1015,7 +1019,8 @@ func TestDeleteChannelBookmark(t *testing.T) {
th := Setup(t).InitBasic()
defer th.TearDown()
th.App.SetPhase2PermissionsMigrationStatus(true)
err := th.App.SetPhase2PermissionsMigrationStatus(true)
require.NoError(t, err)
th.Context.Session().UserId = th.BasicUser.Id // set the user for the session
@@ -1347,7 +1352,8 @@ func TestListChannelBookmarksForChannel(t *testing.T) {
th := Setup(t).InitBasic()
defer th.TearDown()
th.App.SetPhase2PermissionsMigrationStatus(true)
err := th.App.SetPhase2PermissionsMigrationStatus(true)
require.NoError(t, err)
createBookmark := func(name, channelId string) *model.ChannelBookmarkWithFileInfo {
b := &model.ChannelBookmark{