[MM-12465] Added capability to export reactions of posts during bulk export (#9600)

* Added capability to export reactions of posts

* Added capability to export reactions of replies of a post

* Added test case to test the reactions of a post
Этот коммит содержится в:
Wasim Thabraze
2018-10-17 18:53:10 +05:30
коммит произвёл George Goldberg
родитель 1befeb61d0
Коммит 7562f940bb
3 изменённых файлов: 75 добавлений и 1 удалений

32
app/export_test.go Обычный файл
Просмотреть файл

@@ -0,0 +1,32 @@
package app
import (
"github.com/stretchr/testify/assert"
"testing"
"github.com/mattermost/mattermost-server/model"
)
func TestReactionsOfPost(t *testing.T) {
th := Setup().InitBasic()
defer th.TearDown()
post := th.BasicPost
post.HasReactions = true
reactionObject := model.Reaction{
UserId: model.NewId(),
PostId: post.Id,
EmojiName: "emoji",
CreateAt: model.GetMillis(),
}
th.App.SaveReactionForPost(&reactionObject)
reactionsOfPost, err := th.App.BuildPostReactions(post.Id)
if err != nil {
t.Fatal("should have reactions")
}
assert.Equal(t, reactionObject.EmojiName, *(*reactionsOfPost)[0].EmojiName)
}