diff options
author | Carlos Tadeu Panato Junior <ctadeu@gmail.com> | 2018-08-24 11:36:39 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-24 11:36:39 +0200 |
commit | 5876b52ecd0b434dc8fcc0f278c3ce7dcae30d06 (patch) | |
tree | 8fa91548eb37ffa3370fb80160e971bb46d6775a /api4/post_test.go | |
parent | bba3bbd9f3e250cca0ce705e664382fe3ad6e78a (diff) | |
parent | d2945cdd77bdf1ee03367a0d45624094fb936c19 (diff) | |
download | chat-5876b52ecd0b434dc8fcc0f278c3ce7dcae30d06.tar.gz chat-5876b52ecd0b434dc8fcc0f278c3ce7dcae30d06.tar.bz2 chat-5876b52ecd0b434dc8fcc0f278c3ce7dcae30d06.zip |
Merge release-5.2
Diffstat (limited to 'api4/post_test.go')
-rw-r--r-- | api4/post_test.go | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/api4/post_test.go b/api4/post_test.go index 036a64fc7..910443fef 100644 --- a/api4/post_test.go +++ b/api4/post_test.go @@ -1273,6 +1273,16 @@ func TestGetPostThread(t *testing.T) { func TestSearchPosts(t *testing.T) { th := Setup().InitBasic() defer th.TearDown() + experimentalViewArchivedChannels := *th.App.Config().TeamSettings.ExperimentalViewArchivedChannels + defer func() { + th.App.UpdateConfig(func(cfg *model.Config) { + cfg.TeamSettings.ExperimentalViewArchivedChannels = &experimentalViewArchivedChannels + }) + }() + th.App.UpdateConfig(func(cfg *model.Config) { + *cfg.TeamSettings.ExperimentalViewArchivedChannels = true + }) + th.LoginBasic() Client := th.Client @@ -1316,6 +1326,16 @@ func TestSearchPosts(t *testing.T) { t.Fatal("wrong search") } + th.App.UpdateConfig(func(cfg *model.Config) { + *cfg.TeamSettings.ExperimentalViewArchivedChannels = false + }) + + posts, resp = Client.SearchPostsIncludeDeletedChannels(th.BasicTeam.Id, "#hashtag", false) + CheckNoError(t, resp) + if len(posts.Order) != 1 { + t.Fatal("wrong search") + } + if posts, resp = Client.SearchPosts(th.BasicTeam.Id, "*", false); len(posts.Order) != 0 { t.Fatal("searching for just * shouldn't return any results") } |