From 5f8a93fca66215d5c6a16297cfb649ce15526044 Mon Sep 17 00:00:00 2001 From: George Goldberg Date: Wed, 19 Jul 2017 21:57:28 +0100 Subject: PLT-6971: Fix Slack Import of non-ascii channel names. (#6969) --- app/slackimport_test.go | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'app/slackimport_test.go') 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) } } } -- cgit v1.2.3-1-g7c22