summaryrefslogtreecommitdiffstats
path: root/store/storetest/channel_store.go
diff options
context:
space:
mode:
authorHarrison Healey <harrisonmhealey@gmail.com>2017-10-31 11:52:10 -0400
committerGeorge Goldberg <george@gberg.me>2017-10-31 15:52:10 +0000
commit6886de04d4215ea45ae535b64a604a79292bff77 (patch)
treeda3744dbbac2bdf3bd5986da4c59aab649570b68 /store/storetest/channel_store.go
parentb3b46a01aae85594b9b3d2d8872d33d6812492a6 (diff)
downloadchat-6886de04d4215ea45ae535b64a604a79292bff77.tar.gz
chat-6886de04d4215ea45ae535b64a604a79292bff77.tar.bz2
chat-6886de04d4215ea45ae535b64a604a79292bff77.zip
PLT-6071/PLT-8004 Fixed not being able to autocomplete 'Town Square' (#7746)
Diffstat (limited to 'store/storetest/channel_store.go')
-rw-r--r--store/storetest/channel_store.go20
1 files changed, 20 insertions, 0 deletions
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) {