[MM-61499] Fix errcheck issues in server/channels/app/slashcommands/helper_test.go (#30880)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
d452f4f043
Коммит
4dbff921ba
@@ -13,14 +13,13 @@ import (
|
||||
)
|
||||
|
||||
func TestMsgProvider(t *testing.T) {
|
||||
th := setup(t).initBasic()
|
||||
defer th.tearDown()
|
||||
th := setup(t).initBasic(t)
|
||||
|
||||
team := th.createTeam()
|
||||
th.linkUserToTeam(th.BasicUser, team)
|
||||
team := th.createTeam(t)
|
||||
th.linkUserToTeam(t, th.BasicUser, team)
|
||||
cmd := &msgProvider{}
|
||||
|
||||
th.removePermissionFromRole(model.PermissionCreateDirectChannel.Id, model.SystemUserRoleId)
|
||||
th.removePermissionFromRole(t, model.PermissionCreateDirectChannel.Id, model.SystemUserRoleId)
|
||||
|
||||
// Check without permission to create a DM channel.
|
||||
resp := cmd.DoCommand(th.App, th.Context, &model.CommandArgs{
|
||||
@@ -34,7 +33,7 @@ func TestMsgProvider(t *testing.T) {
|
||||
assert.Equal(t, "api.command_msg.permission.app_error", resp.Text)
|
||||
assert.Equal(t, "", resp.GotoLocation)
|
||||
|
||||
th.addPermissionToRole(model.PermissionCreateDirectChannel.Id, model.SystemUserRoleId)
|
||||
th.addPermissionToRole(t, model.PermissionCreateDirectChannel.Id, model.SystemUserRoleId)
|
||||
|
||||
// Check with permission to create a DM channel.
|
||||
resp = cmd.DoCommand(th.App, th.Context, &model.CommandArgs{
|
||||
@@ -59,12 +58,12 @@ func TestMsgProvider(t *testing.T) {
|
||||
assert.Equal(t, "http://test.url/"+team.Name+"/channels/"+channelName, resp.GotoLocation)
|
||||
|
||||
// Check that a guest user cannot message a user who is not in a channel/team with him
|
||||
guest := th.createGuest()
|
||||
user := th.createUser()
|
||||
guest := th.createGuest(t)
|
||||
user := th.createUser(t)
|
||||
|
||||
th.linkUserToTeam(user, team)
|
||||
th.linkUserToTeam(guest, th.BasicTeam)
|
||||
th.addUserToChannel(guest, th.BasicChannel)
|
||||
th.linkUserToTeam(t, user, team)
|
||||
th.linkUserToTeam(t, guest, th.BasicTeam)
|
||||
th.addUserToChannel(t, guest, th.BasicChannel)
|
||||
|
||||
resp = cmd.DoCommand(th.App, th.Context, &model.CommandArgs{
|
||||
T: i18n.IdentityTfunc(),
|
||||
@@ -77,8 +76,8 @@ func TestMsgProvider(t *testing.T) {
|
||||
assert.Equal(t, "", resp.GotoLocation)
|
||||
|
||||
// Check that a guest user can message a user who is in a channel/team with him
|
||||
th.linkUserToTeam(user, th.BasicTeam)
|
||||
th.addUserToChannel(user, th.BasicChannel)
|
||||
th.linkUserToTeam(t, user, th.BasicTeam)
|
||||
th.addUserToChannel(t, user, th.BasicChannel)
|
||||
|
||||
resp = cmd.DoCommand(th.App, th.Context, &model.CommandArgs{
|
||||
T: i18n.IdentityTfunc(),
|
||||
|
||||
Ссылка в новой задаче
Block a user