summaryrefslogtreecommitdiffstats
path: root/api4/apitestlib.go
diff options
context:
space:
mode:
authorMartin Kraft <mkraft@users.noreply.github.com>2018-07-30 15:06:08 -0400
committerGitHub <noreply@github.com>2018-07-30 15:06:08 -0400
commit5872bf9c2f9b81c7aad761d40a6970f6267f1424 (patch)
tree2f850c0678f9fbd8979d41cb758503ca6cb1a2d7 /api4/apitestlib.go
parent65cd447a61efa852da2c0e7db25f385c2436e236 (diff)
downloadchat-5872bf9c2f9b81c7aad761d40a6970f6267f1424.tar.gz
chat-5872bf9c2f9b81c7aad761d40a6970f6267f1424.tar.bz2
chat-5872bf9c2f9b81c7aad761d40a6970f6267f1424.zip
Pr 9039 (#9187)
* MM-11065: Allow to search and get archived channels from the API * Fixing more tests * Add some unit tests * Add includeDeleted parameter to session permissions check function * More test fixing * Adding archive channels list in channels search * Add restriction for archived channel edition * Reverting permissions checks modification * Changed the query parameter to include_deleted * Enable search archive channels as true by default * Adding tests for verify search on deleted channels * Allowing to override archive channels during the imports * Fixed test * Search in archive channels from the API must be explicitly requested * Removing includeDeleted parameter from GetChannelByName and GetChannelByNameForTeam * Back to ViewArchivedChannels config * Fixing tests * Reverting GetChannelByName parameter * Add include deleted parameter on GetChannel functions in plugins api * Fixing tests
Diffstat (limited to 'api4/apitestlib.go')
-rw-r--r--api4/apitestlib.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/api4/apitestlib.go b/api4/apitestlib.go
index fce44cfa1..652a8f882 100644
--- a/api4/apitestlib.go
+++ b/api4/apitestlib.go
@@ -44,6 +44,7 @@ type TestHelper struct {
BasicTeam *model.Team
BasicChannel *model.Channel
BasicPrivateChannel *model.Channel
+ BasicDeletedChannel *model.Channel
BasicChannel2 *model.Channel
BasicPost *model.Post
@@ -250,6 +251,7 @@ func (me *TestHelper) InitBasic() *TestHelper {
me.BasicTeam = me.CreateTeam()
me.BasicChannel = me.CreatePublicChannel()
me.BasicPrivateChannel = me.CreatePrivateChannel()
+ me.BasicDeletedChannel = me.CreatePublicChannel()
me.BasicChannel2 = me.CreatePublicChannel()
me.BasicPost = me.CreatePost()
me.BasicUser = me.CreateUser()
@@ -262,7 +264,10 @@ func (me *TestHelper) InitBasic() *TestHelper {
me.App.AddUserToChannel(me.BasicUser2, me.BasicChannel2)
me.App.AddUserToChannel(me.BasicUser, me.BasicPrivateChannel)
me.App.AddUserToChannel(me.BasicUser2, me.BasicPrivateChannel)
+ me.App.AddUserToChannel(me.BasicUser, me.BasicDeletedChannel)
+ me.App.AddUserToChannel(me.BasicUser2, me.BasicDeletedChannel)
me.App.UpdateUserRoles(me.BasicUser.Id, model.SYSTEM_USER_ROLE_ID, false)
+ me.Client.DeleteChannel(me.BasicDeletedChannel.Id)
me.LoginBasic()
return me