bug fix: after and before search flags should not be inclusive of the selected date (#9327)

* fix for date based flag support to make the after and before flags not inclusive of the selected date

* updated search posts tests using date flags to take into account new non inclusive of the selected date behavior of those flags
Этот коммит содержится в:
Dmitry Samuylov
2018-08-29 18:44:00 -04:00
коммит произвёл Elias Nahum
родитель e742ba7d51
Коммит effa9d33fc
2 изменённых файлов: 17 добавлений и 5 удалений

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

@@ -1581,19 +1581,24 @@ func TestSearchPostsWithDateFlags(t *testing.T) {
resultCount = resultCount + 1
}
}
if resultCount != 3 {
if resultCount != 2 {
t.Fatalf("wrong number of posts returned %v", len(posts.Order))
}
posts, _ = Client.SearchPosts(th.BasicTeam.Id, "before:2018-08-02", false)
if len(posts.Order) != 2 {
if len(posts.Order) != 1 {
t.Fatalf("wrong number of posts returned %v", len(posts.Order))
}
posts, _ = Client.SearchPosts(th.BasicTeam.Id, "before:2018-08-03 after:2018-08-02", false)
if len(posts.Order) != 2 {
if len(posts.Order) != 0 {
t.Fatalf("wrong number of posts returned %v", len(posts.Order))
}
posts, _ = Client.SearchPosts(th.BasicTeam.Id, "before:2018-08-03 after:2018-08-01", false)
if len(posts.Order) != 1 {
t.Fatalf("wrong number of posts returned %v", len(posts.Order))
}
}
func TestGetFileInfosForPost(t *testing.T) {