diff options
author | Vadim <vad.pashkov@gmail.com> | 2018-10-24 17:34:43 +0300 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2018-10-24 07:34:43 -0700 |
commit | 54b7a29581c8d93c876a2a5840b05410f2a35fb9 (patch) | |
tree | edc5077d7a454026f859f44158ae43b46308e856 /app/export_test.go | |
parent | 159c2a44dced5d6331f5fc5e7220e561e6468ad1 (diff) | |
download | chat-54b7a29581c8d93c876a2a5840b05410f2a35fb9.tar.gz chat-54b7a29581c8d93c876a2a5840b05410f2a35fb9.tar.bz2 chat-54b7a29581c8d93c876a2a5840b05410f2a35fb9.zip |
MM-12459 Include User Notify Props in the Bulk Export (#9724)
Diffstat (limited to 'app/export_test.go')
-rw-r--r-- | app/export_test.go | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/app/export_test.go b/app/export_test.go index 05b81387a..bb6d53392 100644 --- a/app/export_test.go +++ b/app/export_test.go @@ -1,10 +1,11 @@ package app import ( - "github.com/stretchr/testify/assert" "testing" "github.com/mattermost/mattermost-server/model" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" ) func TestReactionsOfPost(t *testing.T) { @@ -30,3 +31,31 @@ func TestReactionsOfPost(t *testing.T) { assert.Equal(t, reactionObject.EmojiName, *(*reactionsOfPost)[0].EmojiName) } + +func TestExportUserNotifyProps(t *testing.T) { + + th := Setup().InitBasic() + 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", + } + + exportNotifyProps := th.App.buildUserNotifyProps(userNotifyProps) + + 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.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) +} |