diff options
author | George Goldberg <george@gberg.me> | 2017-04-05 16:41:33 +0100 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2017-04-05 11:41:33 -0400 |
commit | 5986c4a847251e913e4cda3360677e4d0ac1d3f7 (patch) | |
tree | 84e92c5dea4c91e8f88ea16ad4f597b628027282 | |
parent | 6b3b236dd6229c7f6a5594b2c642bb02eadf5100 (diff) | |
download | chat-5986c4a847251e913e4cda3360677e4d0ac1d3f7.tar.gz chat-5986c4a847251e913e4cda3360677e4d0ac1d3f7.tar.bz2 chat-5986c4a847251e913e4cda3360677e4d0ac1d3f7.zip |
PLT-4858: Unit tests to cover this bug. (#5990)
-rw-r--r-- | api4/channel_test.go | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/api4/channel_test.go b/api4/channel_test.go index c5deda83e..1c00c8450 100644 --- a/api4/channel_test.go +++ b/api4/channel_test.go @@ -715,6 +715,30 @@ func TestDeleteChannel(t *testing.T) { t.Fatal("should have failed") } + // check system admin can delete a channel without any appropriate team or channel membership. + sdTeam := th.CreateTeamWithClient(Client) + sdPublicChannel := &model.Channel{ + DisplayName: "dn_" + model.NewId(), + Name: GenerateTestChannelName(), + Type: model.CHANNEL_OPEN, + TeamId: sdTeam.Id, + } + sdPublicChannel, resp = Client.CreateChannel(sdPublicChannel) + CheckNoError(t, resp) + _, resp = th.SystemAdminClient.DeleteChannel(sdPublicChannel.Id) + CheckNoError(t, resp) + + sdPrivateChannel := &model.Channel{ + DisplayName: "dn_" + model.NewId(), + Name: GenerateTestChannelName(), + Type: model.CHANNEL_PRIVATE, + TeamId: sdTeam.Id, + } + sdPrivateChannel, resp = Client.CreateChannel(sdPrivateChannel) + CheckNoError(t, resp) + _, resp = th.SystemAdminClient.DeleteChannel(sdPrivateChannel.Id) + CheckNoError(t, resp) + th.LoginBasic() publicChannel5 := th.CreatePublicChannel() Client.Logout() |