Making the posts tests a bit more robust (#17151)

This commit is contained in:
Jesús Espino
2021-03-16 15:55:55 +01:00
committed by GitHub
parent 4699845c0a
commit c5e1b36dd3

View File

@@ -1335,7 +1335,7 @@ func testPostStoreGetPostsSince(t *testing.T, ss store.Store) {
time.Sleep(time.Millisecond)
postList, err := ss.Post().GetPostsSince(model.GetPostsSinceOptions{ChannelId: channelId, Time: post3.CreateAt}, false)
assert.NoError(t, err)
require.NoError(t, err)
assert.Equal(t, []string{
post6.Id,
@@ -1393,7 +1393,7 @@ func testPostStoreGetPostsSince(t *testing.T, ss store.Store) {
// And then ensure that it doesn't cause future requests to also return no results
postList, err = ss.Post().GetPostsSince(model.GetPostsSinceOptions{ChannelId: channelId, Time: post1.CreateAt - 1}, true)
assert.NoError(t, err)
require.NoError(t, err)
assert.Equal(t, []string{post1.Id}, postList.Order)
@@ -1499,7 +1499,7 @@ func testPostStoreGetPosts(t *testing.T, ss store.Store) {
t.Run("should return the last posts created in a channel without the threads and the reply count must be correct", func(t *testing.T) {
postList, err := ss.Post().GetPosts(model.GetPostsOptions{ChannelId: channelId, Page: 0, PerPage: 2, SkipFetchThreads: true}, false)
assert.NoError(t, err)
require.NoError(t, err)
assert.Equal(t, []string{
post6.Id,