summaryrefslogtreecommitdiffstats
path: root/api4/channel_test.go
diff options
context:
space:
mode:
authorRobin Naundorf <r.naundorf@fh-muenster.de>2017-05-15 22:12:30 +0200
committerJoram Wilander <jwawilander@gmail.com>2017-05-15 16:12:30 -0400
commit0a20e8d3269515e2d44a0bcad0a2408f62245814 (patch)
tree533767c6a60939504f8f70c60bd4ff77ef0e8fe7 /api4/channel_test.go
parent34728f748bfd7976c085f1be77e53f70d6e55a06 (diff)
downloadchat-0a20e8d3269515e2d44a0bcad0a2408f62245814.tar.gz
chat-0a20e8d3269515e2d44a0bcad0a2408f62245814.tar.bz2
chat-0a20e8d3269515e2d44a0bcad0a2408f62245814.zip
PLT-6019: Add APIv4 Endpoint for restoring Channels (#6263)
Diffstat (limited to 'api4/channel_test.go')
-rw-r--r--api4/channel_test.go26
1 files changed, 26 insertions, 0 deletions
diff --git a/api4/channel_test.go b/api4/channel_test.go
index b4f08dc37..f25cbf706 100644
--- a/api4/channel_test.go
+++ b/api4/channel_test.go
@@ -1067,6 +1067,32 @@ func TestDeleteChannel(t *testing.T) {
CheckNoError(t, resp)
}
+func TestRestoreChannel(t *testing.T) {
+ th := Setup().InitBasic().InitSystemAdmin()
+ defer TearDown()
+ Client := th.Client
+
+ publicChannel1 := th.CreatePublicChannel()
+ Client.DeleteChannel(publicChannel1.Id)
+
+ privateChannel1 := th.CreatePrivateChannel()
+ Client.DeleteChannel(privateChannel1.Id)
+
+ _, resp := Client.RestoreChannel(publicChannel1.Id)
+ CheckForbiddenStatus(t, resp)
+
+ _, resp = Client.RestoreChannel(privateChannel1.Id)
+ CheckForbiddenStatus(t, resp)
+
+ th.LoginTeamAdmin()
+
+ _, resp = Client.RestoreChannel(publicChannel1.Id)
+ CheckOKStatus(t, resp)
+
+ _, resp = Client.RestoreChannel(privateChannel1.Id)
+ CheckOKStatus(t, resp)
+ }
+
func TestGetChannelByName(t *testing.T) {
th := Setup().InitBasic().InitSystemAdmin()
defer TearDown()