summaryrefslogtreecommitdiffstats
path: root/api4
diff options
context:
space:
mode:
authorJesús Espino <jespinog@gmail.com>2018-08-03 10:44:32 +0200
committerGitHub <noreply@github.com>2018-08-03 10:44:32 +0200
commit8cc4f27f7cb17af34951ad4c7a59ca7bad082f61 (patch)
treec1776cc305ab1a80a451d36765447b61511d4ab4 /api4
parent7a731d2bd162419086f3aeec98ec41dfcaa16696 (diff)
downloadchat-8cc4f27f7cb17af34951ad4c7a59ca7bad082f61.tar.gz
chat-8cc4f27f7cb17af34951ad4c7a59ca7bad082f61.tar.bz2
chat-8cc4f27f7cb17af34951ad4c7a59ca7bad082f61.zip
MM-11529: Allow to Leave an archived channel from the API (#9204)
* MM-11529: Allow to Leave an archived channel from the API * Remove the restriction to remove user from archive channel to yourself
Diffstat (limited to 'api4')
-rw-r--r--api4/channel_test.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/api4/channel_test.go b/api4/channel_test.go
index 4645a0ab6..c2a0131cf 100644
--- a/api4/channel_test.go
+++ b/api4/channel_test.go
@@ -1974,6 +1974,18 @@ func TestRemoveChannelMember(t *testing.T) {
_, resp = th.SystemAdminClient.RemoveUserFromChannel(th.BasicChannel.Id, th.BasicUser.Id)
CheckNoError(t, resp)
+ // Leave deleted channel
+ th.LoginBasic()
+ deletedChannel := th.CreatePublicChannel()
+ th.App.AddUserToChannel(th.BasicUser, deletedChannel)
+ th.App.AddUserToChannel(th.BasicUser2, deletedChannel)
+
+ deletedChannel.DeleteAt = 1
+ th.App.UpdateChannel(deletedChannel)
+
+ _, resp = Client.RemoveUserFromChannel(deletedChannel.Id, th.BasicUser.Id)
+ CheckNoError(t, resp)
+
th.LoginBasic()
private := th.CreatePrivateChannel()
th.App.AddUserToChannel(th.BasicUser2, private)