summaryrefslogtreecommitdiffstats
path: root/app/import_test.go
diff options
context:
space:
mode:
authorFurmanovD <39990503+FurmanovD@users.noreply.github.com>2018-09-17 13:46:06 +0300
committerGeorge Goldberg <george@gberg.me>2018-09-17 11:46:06 +0100
commit517faccc332ce48de43e597d1b2d29a3961241e7 (patch)
tree38470bb23b9547b8efca92d3341dd023f5f2e999 /app/import_test.go
parent35c148d2551bbb65a6d469b44876ba78578397c1 (diff)
downloadchat-517faccc332ce48de43e597d1b2d29a3961241e7.tar.gz
chat-517faccc332ce48de43e597d1b2d29a3961241e7.tar.bz2
chat-517faccc332ce48de43e597d1b2d29a3961241e7.zip
MM-11424 Extend bulk import to support themes across teams(#9305) (#9419)
* MM-11424 Extend bulk import to support themes across teams(#9305) Also added: Advanced Settings: +'feature_enabled_markdown_preview' +'formatting' Sidebar Settings: +'show_unread_section' * MM-11424 (PR review) user teams' theme validator test updated * MM-11424 (PR review) added test with valid JSON of invalid theme(by structure) JSON string contains numeric and JSON object fields, not just a correct "string":"string" map
Diffstat (limited to 'app/import_test.go')
-rw-r--r--app/import_test.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/app/import_test.go b/app/import_test.go
index 839c46bb8..89c8344e6 100644
--- a/app/import_test.go
+++ b/app/import_test.go
@@ -173,13 +173,15 @@ func TestImportBulkImport(t *testing.T) {
emojiName := model.NewId()
testsDir, _ := utils.FindDir("tests")
testImage := filepath.Join(testsDir, "test.png")
+ teamTheme1 := `{\"awayIndicator\":\"#DBBD4E\",\"buttonBg\":\"#23A1FF\",\"buttonColor\":\"#FFFFFF\",\"centerChannelBg\":\"#ffffff\",\"centerChannelColor\":\"#333333\",\"codeTheme\":\"github\",\"image\":\"/static/files/a4a388b38b32678e83823ef1b3e17766.png\",\"linkColor\":\"#2389d7\",\"mentionBg\":\"#2389d7\",\"mentionColor\":\"#ffffff\",\"mentionHighlightBg\":\"#fff2bb\",\"mentionHighlightLink\":\"#2f81b7\",\"newMessageSeparator\":\"#FF8800\",\"onlineIndicator\":\"#7DBE00\",\"sidebarBg\":\"#fafafa\",\"sidebarHeaderBg\":\"#3481B9\",\"sidebarHeaderTextColor\":\"#ffffff\",\"sidebarText\":\"#333333\",\"sidebarTextActiveBorder\":\"#378FD2\",\"sidebarTextActiveColor\":\"#111111\",\"sidebarTextHoverBg\":\"#e6f2fa\",\"sidebarUnreadText\":\"#333333\",\"type\":\"Mattermost\"}`
+ teamTheme2 := `{\"awayIndicator\":\"#DBBD4E\",\"buttonBg\":\"#23A100\",\"buttonColor\":\"#EEEEEE\",\"centerChannelBg\":\"#ffffff\",\"centerChannelColor\":\"#333333\",\"codeTheme\":\"github\",\"image\":\"/static/files/a4a388b38b32678e83823ef1b3e17766.png\",\"linkColor\":\"#2389d7\",\"mentionBg\":\"#2389d7\",\"mentionColor\":\"#ffffff\",\"mentionHighlightBg\":\"#fff2bb\",\"mentionHighlightLink\":\"#2f81b7\",\"newMessageSeparator\":\"#FF8800\",\"onlineIndicator\":\"#7DBE00\",\"sidebarBg\":\"#fafafa\",\"sidebarHeaderBg\":\"#3481B9\",\"sidebarHeaderTextColor\":\"#ffffff\",\"sidebarText\":\"#333333\",\"sidebarTextActiveBorder\":\"#378FD2\",\"sidebarTextActiveColor\":\"#222222\",\"sidebarTextHoverBg\":\"#e6f2fa\",\"sidebarUnreadText\":\"#444444\",\"type\":\"Mattermost\"}`
// Run bulk import with a valid 1 of everything.
data1 := `{"type": "version", "version": 1}
{"type": "team", "team": {"type": "O", "display_name": "lskmw2d7a5ao7ppwqh5ljchvr4", "name": "` + teamName + `"}}
{"type": "channel", "channel": {"type": "O", "display_name": "xr6m6udffngark2uekvr3hoeny", "team": "` + teamName + `", "name": "` + channelName + `"}}
-{"type": "user", "user": {"username": "` + username + `", "email": "` + username + `@example.com", "teams": [{"name": "` + teamName + `", "channels": [{"name": "` + channelName + `"}]}]}}
-{"type": "user", "user": {"username": "` + username2 + `", "email": "` + username2 + `@example.com", "teams": [{"name": "` + teamName + `", "channels": [{"name": "` + channelName + `"}]}]}}
+{"type": "user", "user": {"username": "` + username + `", "email": "` + username + `@example.com", "teams": [{"name": "` + teamName + `","theme": "` + teamTheme1 + `", "channels": [{"name": "` + channelName + `"}]}]}}
+{"type": "user", "user": {"username": "` + username2 + `", "email": "` + username2 + `@example.com", "teams": [{"name": "` + teamName + `","theme": "` + teamTheme2 + `", "channels": [{"name": "` + channelName + `"}]}]}}
{"type": "user", "user": {"username": "` + username3 + `", "email": "` + username3 + `@example.com", "teams": [{"name": "` + teamName + `", "channels": [{"name": "` + channelName + `"}]}]}}
{"type": "post", "post": {"team": "` + teamName + `", "channel": "` + channelName + `", "user": "` + username + `", "message": "Hello World", "create_at": 123456789012, "attachments":[{"path": "` + testImage + `"}]}}
{"type": "direct_channel", "direct_channel": {"members": ["` + username + `", "` + username2 + `"]}}