summaryrefslogtreecommitdiffstats
path: root/api4/channel_test.go
diff options
context:
space:
mode:
authorSaturnino Abril <saturnino.abril@gmail.com>2018-05-05 02:16:00 +0800
committerGitHub <noreply@github.com>2018-05-05 02:16:00 +0800
commit30fd4a2951906a59137312d6d1dea2e54fe9c8e9 (patch)
treeddd3ef0615a7b6c47d4ae7e6aab45ad104a9f017 /api4/channel_test.go
parent37b3805ca6b260a6075a522be46a948c9e54e58b (diff)
downloadchat-30fd4a2951906a59137312d6d1dea2e54fe9c8e9.tar.gz
chat-30fd4a2951906a59137312d6d1dea2e54fe9c8e9.tar.bz2
chat-30fd4a2951906a59137312d6d1dea2e54fe9c8e9.zip
update permission of converting a channel from public to private to allow team admin (#8723)
Diffstat (limited to 'api4/channel_test.go')
-rw-r--r--api4/channel_test.go12
1 files changed, 8 insertions, 4 deletions
diff --git a/api4/channel_test.go b/api4/channel_test.go
index 767fdbdb8..b428a382a 100644
--- a/api4/channel_test.go
+++ b/api4/channel_test.go
@@ -915,10 +915,13 @@ func TestConvertChannelToPrivate(t *testing.T) {
CheckForbiddenStatus(t, resp)
th.LoginTeamAdmin()
- _, resp = Client.ConvertChannelToPrivate(publicChannel.Id)
- CheckForbiddenStatus(t, resp)
+ rchannel, resp := Client.ConvertChannelToPrivate(publicChannel.Id)
+ CheckOKStatus(t, resp)
+ if rchannel.Type != model.CHANNEL_PRIVATE {
+ t.Fatal("channel should be converted from public to private")
+ }
- rchannel, resp := th.SystemAdminClient.ConvertChannelToPrivate(privateChannel.Id)
+ rchannel, resp = th.SystemAdminClient.ConvertChannelToPrivate(privateChannel.Id)
CheckBadRequestStatus(t, resp)
if rchannel != nil {
t.Fatal("should not return a channel")
@@ -930,7 +933,8 @@ func TestConvertChannelToPrivate(t *testing.T) {
t.Fatal("should not return a channel")
}
- rchannel, resp = th.SystemAdminClient.ConvertChannelToPrivate(publicChannel.Id)
+ publicChannel2 := th.CreatePublicChannel()
+ rchannel, resp = th.SystemAdminClient.ConvertChannelToPrivate(publicChannel2.Id)
CheckOKStatus(t, resp)
if rchannel.Type != model.CHANNEL_PRIVATE {
t.Fatal("channel should be converted from public to private")