PLT-6019: Add APIv4 Endpoint for restoring Channels (#6263)

Этот коммит содержится в:
Robin Naundorf
2017-05-15 22:12:30 +02:00
коммит произвёл Joram Wilander
родитель 34728f748b
Коммит 0a20e8d326
7 изменённых файлов: 108 добавлений и 0 удалений

Просмотреть файл

@@ -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()