MM-13220: Fixes for bulk export problems (#9980)

* MM-13220: Fixes for bulk export problems

* fixing tests
Этот коммит содержится в:
Jesús Espino
2018-12-12 14:20:22 +01:00
коммит произвёл GitHub
родитель a7b6c71421
Коммит febc5115fd
4 изменённых файлов: 23 добавлений и 24 удалений

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

@@ -18,7 +18,7 @@ func TestReactionsOfPost(t *testing.T) {
post.HasReactions = true
reactionObject := model.Reaction{
UserId: model.NewId(),
UserId: th.BasicUser.Id,
PostId: post.Id,
EmojiName: "emoji",
CreateAt: model.GetMillis(),
@@ -26,10 +26,7 @@ func TestReactionsOfPost(t *testing.T) {
th.App.SaveReactionForPost(&reactionObject)
reactionsOfPost, err := th.App.BuildPostReactions(post.Id)
if err != nil {
t.Fatal("should have reactions")
}
require.Nil(t, err)
assert.Equal(t, reactionObject.EmojiName, *(*reactionsOfPost)[0].EmojiName)
}
@@ -40,14 +37,14 @@ func TestExportUserNotifyProps(t *testing.T) {
defer th.TearDown()
userNotifyProps := model.StringMap{
model.DESKTOP_NOTIFY_PROP: model.USER_NOTIFY_ALL,
model.DESKTOP_SOUND_NOTIFY_PROP: "true",
model.EMAIL_NOTIFY_PROP: "true",
model.MOBILE_NOTIFY_PROP: model.USER_NOTIFY_ALL,
model.MOBILE_PUSH_STATUS_NOTIFY_PROP: model.STATUS_ONLINE,
model.CHANNEL_MENTIONS_NOTIFY_PROP: "true",
model.COMMENTS_NOTIFY_PROP: model.COMMENTS_NOTIFY_ROOT,
model.MENTION_KEYS_NOTIFY_PROP: "valid,misc",
model.DESKTOP_NOTIFY_PROP: model.USER_NOTIFY_ALL,
model.DESKTOP_SOUND_NOTIFY_PROP: "true",
model.EMAIL_NOTIFY_PROP: "true",
model.PUSH_NOTIFY_PROP: model.USER_NOTIFY_ALL,
model.PUSH_STATUS_NOTIFY_PROP: model.STATUS_ONLINE,
model.CHANNEL_MENTIONS_NOTIFY_PROP: "true",
model.COMMENTS_NOTIFY_PROP: model.COMMENTS_NOTIFY_ROOT,
model.MENTION_KEYS_NOTIFY_PROP: "valid,misc",
}
exportNotifyProps := th.App.buildUserNotifyProps(userNotifyProps)
@@ -55,8 +52,8 @@ func TestExportUserNotifyProps(t *testing.T) {
require.Equal(t, userNotifyProps[model.DESKTOP_NOTIFY_PROP], *exportNotifyProps.Desktop)
require.Equal(t, userNotifyProps[model.DESKTOP_SOUND_NOTIFY_PROP], *exportNotifyProps.DesktopSound)
require.Equal(t, userNotifyProps[model.EMAIL_NOTIFY_PROP], *exportNotifyProps.Email)
require.Equal(t, userNotifyProps[model.MOBILE_NOTIFY_PROP], *exportNotifyProps.Mobile)
require.Equal(t, userNotifyProps[model.MOBILE_PUSH_STATUS_NOTIFY_PROP], *exportNotifyProps.MobilePushStatus)
require.Equal(t, userNotifyProps[model.PUSH_NOTIFY_PROP], *exportNotifyProps.Mobile)
require.Equal(t, userNotifyProps[model.PUSH_STATUS_NOTIFY_PROP], *exportNotifyProps.MobilePushStatus)
require.Equal(t, userNotifyProps[model.CHANNEL_MENTIONS_NOTIFY_PROP], *exportNotifyProps.ChannelTrigger)
require.Equal(t, userNotifyProps[model.COMMENTS_NOTIFY_PROP], *exportNotifyProps.CommentsTrigger)
require.Equal(t, userNotifyProps[model.MENTION_KEYS_NOTIFY_PROP], *exportNotifyProps.MentionKeys)