diff options
Diffstat (limited to 'app/export_test.go')
-rw-r--r-- | app/export_test.go | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/app/export_test.go b/app/export_test.go new file mode 100644 index 000000000..05b81387a --- /dev/null +++ b/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) +} |