diff options
author | George Goldberg <george@gberg.me> | 2018-08-22 20:12:51 +0100 |
---|---|---|
committer | Carlos Tadeu Panato Junior <ctadeu@gmail.com> | 2018-08-22 21:12:51 +0200 |
commit | d2945cdd77bdf1ee03367a0d45624094fb936c19 (patch) | |
tree | 7289f0a5d85b7c37e1fe5bf02cb40ab30623d0fa /api4 | |
parent | 43483805eabcb36ef9018f12a82a6d3ac055baf5 (diff) | |
download | chat-d2945cdd77bdf1ee03367a0d45624094fb936c19.tar.gz chat-d2945cdd77bdf1ee03367a0d45624094fb936c19.tar.bz2 chat-d2945cdd77bdf1ee03367a0d45624094fb936c19.zip |
MM-11782: Make archived channels experimental and off-by-default. (#9281)
* MM-11782: Make archived channels experimental and off-by-default.
* Fix test.
Diffstat (limited to 'api4')
-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") } |