From 6886de04d4215ea45ae535b64a604a79292bff77 Mon Sep 17 00:00:00 2001 From: Harrison Healey Date: Tue, 31 Oct 2017 11:52:10 -0400 Subject: PLT-6071/PLT-8004 Fixed not being able to autocomplete 'Town Square' (#7746) --- store/storetest/channel_store.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'store/storetest/channel_store.go') diff --git a/store/storetest/channel_store.go b/store/storetest/channel_store.go index cb4e8fa26..1189fd976 100644 --- a/store/storetest/channel_store.go +++ b/store/storetest/channel_store.go @@ -1861,6 +1861,13 @@ func testChannelStoreSearchInTeam(t *testing.T, ss store.Store) { o8.Type = model.CHANNEL_PRIVATE store.Must(ss.Channel().Save(&o8, -1)) + o9 := model.Channel{} + o9.TeamId = o1.TeamId + o9.DisplayName = "Town Square" + o9.Name = "town-square" + o9.Type = model.CHANNEL_OPEN + store.Must(ss.Channel().Save(&o9, -1)) + if result := <-ss.Channel().SearchInTeam(o1.TeamId, "ChannelA"); result.Err != nil { t.Fatal(result.Err) } else { @@ -1926,6 +1933,19 @@ func testChannelStoreSearchInTeam(t *testing.T, ss store.Store) { t.Fatal("should be empty") } } + + if result := <-ss.Channel().SearchInTeam(o1.TeamId, "town square"); result.Err != nil { + t.Fatal(result.Err) + } else { + channels := result.Data.(*model.ChannelList) + if len(*channels) != 1 { + t.Fatal("should return 1 channel") + } + + if (*channels)[0].Name != o9.Name { + t.Fatal("wrong channel returned") + } + } } func testChannelStoreGetMembersByIds(t *testing.T, ss store.Store) { -- cgit v1.2.3-1-g7c22