unparam lint (#16771)
* fixed: `identifier` is unused lint error * make saveMultipleMembersT method saveMultipleMembers Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
78ccf8a775
Коммит
a63dea6c55
@@ -1856,16 +1856,14 @@ func TestImportUserChannels(t *testing.T) {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
user := th.CreateUser()
|
||||
th.App.joinUserToTeam(th.BasicTeam, user)
|
||||
teamMember, err := th.App.GetTeamMember(th.BasicTeam.Id, user.Id)
|
||||
require.Nil(t, err)
|
||||
|
||||
// Two times import must end with the same results
|
||||
for x := 0; x < 2; x++ {
|
||||
err = th.App.importUserChannels(user, th.BasicTeam, teamMember, tc.data)
|
||||
appErr := th.App.importUserChannels(user, th.BasicTeam, tc.data)
|
||||
if tc.expectedError {
|
||||
require.NotNil(t, err)
|
||||
require.NotNil(t, appErr)
|
||||
} else {
|
||||
require.Nil(t, err)
|
||||
require.Nil(t, appErr)
|
||||
}
|
||||
channelMembers, err := th.App.Srv().Store.Channel().GetMembersForUser(th.BasicTeam.Id, user.Id)
|
||||
require.Nil(t, err)
|
||||
@@ -3101,7 +3099,7 @@ func TestImportImportDirectChannel(t *testing.T) {
|
||||
th.BasicUser2.Id,
|
||||
user3.Id,
|
||||
}
|
||||
channel, appErr := th.App.createGroupChannel(userIds, th.BasicUser.Id)
|
||||
channel, appErr := th.App.createGroupChannel(userIds)
|
||||
require.Equal(t, appErr.Id, store.ChannelExistsError)
|
||||
require.Equal(t, channel.Header, *data.Header)
|
||||
|
||||
@@ -3402,7 +3400,7 @@ func TestImportImportDirectPost(t *testing.T) {
|
||||
th.BasicUser2.Id,
|
||||
user3.Id,
|
||||
}
|
||||
channel, appErr = th.App.createGroupChannel(userIds, th.BasicUser.Id)
|
||||
channel, appErr = th.App.createGroupChannel(userIds)
|
||||
require.Equal(t, appErr.Id, store.ChannelExistsError)
|
||||
groupChannel = channel
|
||||
|
||||
@@ -3893,14 +3891,14 @@ func TestImportAttachment(t *testing.T) {
|
||||
|
||||
userId := model.NewId()
|
||||
data := AttachmentImportData{Path: &testImage}
|
||||
_, err := th.App.importAttachment(&data, &model.Post{UserId: userId, ChannelId: "some-channel"}, "some-team", true)
|
||||
_, err := th.App.importAttachment(&data, &model.Post{UserId: userId, ChannelId: "some-channel"}, "some-team")
|
||||
assert.Nil(t, err, "sample run without errors")
|
||||
|
||||
attachments := GetAttachments(userId, th, t)
|
||||
assert.Len(t, attachments, 1)
|
||||
|
||||
data = AttachmentImportData{Path: &invalidPath}
|
||||
_, err = th.App.importAttachment(&data, &model.Post{UserId: model.NewId(), ChannelId: "some-channel"}, "some-team", true)
|
||||
_, err = th.App.importAttachment(&data, &model.Post{UserId: model.NewId(), ChannelId: "some-channel"}, "some-team")
|
||||
assert.NotNil(t, err, "should have failed when opening the file")
|
||||
assert.Equal(t, err.Id, "app.import.attachment.bad_file.error")
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user