提交 98d091bc 编写于 作者: N Nevyana Angelova

Fix test and error

上级 4b03dc1d
......@@ -3221,17 +3221,6 @@ func TestRemoveChannelMember(t *testing.T) {
resp, err = th.SystemAdminClient.RemoveUserFromChannel(directChannel.Id, user1.Id)
require.Error(t, err)
CheckBadRequestStatus(t, resp)
// Test on preventing removal of user from a group channel
user3 := th.CreateUser()
groupChannel, _, err := client.CreateGroupChannel([]string{user1.Id, user2.Id, user3.Id})
require.NoError(t, err)
th.TestForAllClients(t, func(t *testing.T, client *model.Client4) {
resp, err = client.RemoveUserFromChannel(groupChannel.Id, user1.Id)
require.Error(t, err)
CheckBadRequestStatus(t, resp)
})
}
func TestAutocompleteChannels(t *testing.T) {
......
......@@ -2170,7 +2170,7 @@ func (a *App) LeaveChannel(c *request.Context, channelID string, userID string)
user := uresult.Data.(*model.User)
membersCount := ccresult.Data.(int64)
if channel.Type == model.ChannelTypePrivate {
if channel.Type == model.ChannelTypeDirect {
err := model.NewAppError("LeaveChannel", "api.channel.leave.direct.app_error", nil, "", http.StatusBadRequest)
return err
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册