diff options
Diffstat (limited to 'store/storetest/channel_store.go')
-rw-r--r-- | store/storetest/channel_store.go | 20 |
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) { |