MM-13021 Fix warning logged when getting metadata for post without emojis (#9832)

Этот коммит содержится в:
Harrison Healey
2018-11-14 11:54:50 -05:00
коммит произвёл Sudheer
родитель d07def5169
Коммит 2113ad0205
2 изменённых файлов: 15 добавлений и 0 удалений

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

@@ -663,6 +663,17 @@ func TestGetCustomEmojisForPost(t *testing.T) {
assert.Nil(t, err, "failed to get emojis for post")
assert.ElementsMatch(t, emojisForPost, []*model.Emoji{emojis[0]}, "received incorrect emojis")
})
t.Run("with no emojis", func(t *testing.T) {
post := &model.Post{
Message: "this post is boring",
Props: map[string]interface{}{},
}
emojisForPost, err := th.App.getCustomEmojisForPost(post, nil)
assert.Nil(t, err, "failed to get emojis for post")
assert.ElementsMatch(t, emojisForPost, []*model.Emoji{}, "should have received no emojis")
})
}
func TestGetFirstLinkAndImages(t *testing.T) {