summaryrefslogtreecommitdiffstats
path: root/app/slackimport_test.go
diff options
context:
space:
mode:
authorGeorge Goldberg <george@gberg.me>2017-07-19 21:57:28 +0100
committerChristopher Speller <crspeller@gmail.com>2017-07-19 13:57:28 -0700
commit5f8a93fca66215d5c6a16297cfb649ce15526044 (patch)
tree5074ce219b7997101a24086ee3bf255e22fd1b9c /app/slackimport_test.go
parentecb82dbd1286f0cc722c082eada862b35fe92105 (diff)
downloadchat-5f8a93fca66215d5c6a16297cfb649ce15526044.tar.gz
chat-5f8a93fca66215d5c6a16297cfb649ce15526044.tar.bz2
chat-5f8a93fca66215d5c6a16297cfb649ce15526044.zip
PLT-6971: Fix Slack Import of non-ascii channel names. (#6969)
Diffstat (limited to 'app/slackimport_test.go')
-rw-r--r--app/slackimport_test.go18
1 files changed, 10 insertions, 8 deletions
diff --git a/app/slackimport_test.go b/app/slackimport_test.go
index 87de597ca..38f5e2e9b 100644
--- a/app/slackimport_test.go
+++ b/app/slackimport_test.go
@@ -23,19 +23,21 @@ func TestSlackConvertTimeStamp(t *testing.T) {
func TestSlackConvertChannelName(t *testing.T) {
var testData = []struct {
- input string
+ nameInput string
+ idInput string
output string
}{
- {"test-channel", "test-channel"},
- {"_test_channel_", "test_channel"},
- {"__test", "test"},
- {"-t", "slack-channel-t"},
- {"a", "slack-channel-a"},
+ {"test-channel", "C0G08DLQH", "test-channel"},
+ {"_test_channel_", "C0G04DLQH", "test_channel"},
+ {"__test", "C0G07DLQH", "test"},
+ {"-t", "C0G06DLQH", "slack-channel-t"},
+ {"a", "C0G05DLQH", "slack-channel-a"},
+ {"случайный", "C0G05DLQD", "c0g05dlqd"},
}
for _, td := range testData {
- if td.output != SlackConvertChannelName(td.input) {
- t.Fatalf("Did not convert channel name correctly: %v", td.input)
+ if td.output != SlackConvertChannelName(td.nameInput, td.idInput) {
+ t.Fatalf("Did not convert channel name correctly: %v", td.nameInput)
}
}
}