Этот коммит содержится в:
Carlos Tadeu Panato Junior
2018-08-24 11:36:39 +02:00
коммит произвёл GitHub
родитель bba3bbd9f3 d2945cdd77
Коммит 5876b52ecd
7 изменённых файлов: 29 добавлений и 9 удалений

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

@@ -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")
}