From a21a06afd9907e9911dcb166d902cba9f405c7cb Mon Sep 17 00:00:00 2001 From: Harrison Healey Date: Thu, 11 May 2017 16:32:14 -0400 Subject: PLT-6556 Fixed last member of a channel not being able to delete channel with api v4 (#6397) --- api4/channel_test.go | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'api4/channel_test.go') diff --git a/api4/channel_test.go b/api4/channel_test.go index 345bbefaf..c2c1bcf56 100644 --- a/api4/channel_test.go +++ b/api4/channel_test.go @@ -1006,6 +1006,16 @@ func TestDeleteChannel(t *testing.T) { _, resp = th.SystemAdminClient.DeleteChannel(privateChannel7.Id) CheckNoError(t, resp) + + // last member of a channel should be able to delete it regardless of required permissions + publicChannel6 = th.CreateChannelWithClient(th.Client, model.CHANNEL_OPEN) + privateChannel7 = th.CreateChannelWithClient(th.Client, model.CHANNEL_PRIVATE) + + _, resp = Client.DeleteChannel(publicChannel6.Id) + CheckNoError(t, resp) + + _, resp = Client.DeleteChannel(privateChannel7.Id) + CheckNoError(t, resp) } func TestGetChannelByName(t *testing.T) { -- cgit v1.2.3-1-g7c22