[GH-28353] Fix errcheck issues in server/channels/api4/channel_bookmark_test.go (#28358)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
076a3cb0d5
Коммит
c5a504883d
@@ -64,7 +64,6 @@ issues:
|
|||||||
channels/api4/brand.go|\
|
channels/api4/brand.go|\
|
||||||
channels/api4/brand_test.go|\
|
channels/api4/brand_test.go|\
|
||||||
channels/api4/channel.go|\
|
channels/api4/channel.go|\
|
||||||
channels/api4/channel_bookmark_test.go|\
|
|
||||||
channels/api4/channel_category.go|\
|
channels/api4/channel_category.go|\
|
||||||
channels/api4/channel_test.go|\
|
channels/api4/channel_test.go|\
|
||||||
channels/api4/cloud.go|\
|
channels/api4/cloud.go|\
|
||||||
|
|||||||
@@ -22,7 +22,8 @@ func TestCreateChannelBookmark(t *testing.T) {
|
|||||||
|
|
||||||
th := Setup(t).InitBasic()
|
th := Setup(t).InitBasic()
|
||||||
defer th.TearDown()
|
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) {
|
t.Run("should not work without a license", func(t *testing.T) {
|
||||||
channelBookmark := &model.ChannelBookmark{
|
channelBookmark := &model.ChannelBookmark{
|
||||||
@@ -268,7 +269,8 @@ func TestEditChannelBookmark(t *testing.T) {
|
|||||||
|
|
||||||
th := Setup(t).InitBasic()
|
th := Setup(t).InitBasic()
|
||||||
defer th.TearDown()
|
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) {
|
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{})
|
_, _, 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()
|
th := Setup(t).InitBasic()
|
||||||
defer th.TearDown()
|
defer th.TearDown()
|
||||||
th.App.SetPhase2PermissionsMigrationStatus(true)
|
err := th.App.SetPhase2PermissionsMigrationStatus(true)
|
||||||
|
require.NoError(t, err)
|
||||||
|
|
||||||
createBookmark := func(name, channelId string) *model.ChannelBookmarkWithFileInfo {
|
createBookmark := func(name, channelId string) *model.ChannelBookmarkWithFileInfo {
|
||||||
b := &model.ChannelBookmark{
|
b := &model.ChannelBookmark{
|
||||||
@@ -780,7 +783,8 @@ func TestUpdateChannelBookmarkSortOrder(t *testing.T) {
|
|||||||
originalBookmark, appErr := th.App.GetBookmark(tc.bookmarkId, false)
|
originalBookmark, appErr := th.App.GetBookmark(tc.bookmarkId, false)
|
||||||
require.Nil(t, appErr)
|
require.Nil(t, appErr)
|
||||||
defer func() {
|
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)
|
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()
|
th := Setup(t).InitBasic()
|
||||||
defer th.TearDown()
|
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
|
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()
|
th := Setup(t).InitBasic()
|
||||||
defer th.TearDown()
|
defer th.TearDown()
|
||||||
th.App.SetPhase2PermissionsMigrationStatus(true)
|
err := th.App.SetPhase2PermissionsMigrationStatus(true)
|
||||||
|
require.NoError(t, err)
|
||||||
|
|
||||||
createBookmark := func(name, channelId string) *model.ChannelBookmarkWithFileInfo {
|
createBookmark := func(name, channelId string) *model.ChannelBookmarkWithFileInfo {
|
||||||
b := &model.ChannelBookmark{
|
b := &model.ChannelBookmark{
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user