summaryrefslogtreecommitdiffstats
path: root/store/sql_channel_store_test.go
diff options
context:
space:
mode:
authorCorey Hulen <corey@hulen.com>2016-11-24 05:26:45 -0800
committerHarrison Healey <harrisonmhealey@gmail.com>2016-11-24 08:26:45 -0500
commitb212acf312ad640455fa715427ac19e6930dc61d (patch)
tree8fb977e00bef33587c3199ad3617417b27fb6b8a /store/sql_channel_store_test.go
parent0f07a2d288bada5e08cd9a63047ee85ef60738f5 (diff)
downloadchat-b212acf312ad640455fa715427ac19e6930dc61d.tar.gz
chat-b212acf312ad640455fa715427ac19e6930dc61d.tar.bz2
chat-b212acf312ad640455fa715427ac19e6930dc61d.zip
PLT-4429 disabling at_all at_channel metions mentions when channel has more than 1k users (#4627)
* PLT-4429 disabling explicit mentions when channel has more than 1k users * Fixing test case * Adding setting to the admin console * Fixing bad translation
Diffstat (limited to 'store/sql_channel_store_test.go')
-rw-r--r--store/sql_channel_store_test.go26
1 files changed, 18 insertions, 8 deletions
diff --git a/store/sql_channel_store_test.go b/store/sql_channel_store_test.go
index 8a51d2ae3..6776a438b 100644
--- a/store/sql_channel_store_test.go
+++ b/store/sql_channel_store_test.go
@@ -384,14 +384,24 @@ func TestChannelMemberStore(t *testing.T) {
t.Fatal("Member update time incorrect")
}
- count := (<-store.Channel().GetMemberCount(o1.ChannelId)).Data.(int64)
+ count := (<-store.Channel().GetMemberCount(o1.ChannelId, true)).Data.(int64)
+ if count != 2 {
+ t.Fatal("should have saved 2 members")
+ }
+
+ count = (<-store.Channel().GetMemberCount(o1.ChannelId, true)).Data.(int64)
+ if count != 2 {
+ t.Fatal("should have saved 2 members")
+ }
+
+ count = (<-store.Channel().GetMemberCount(o1.ChannelId, false)).Data.(int64)
if count != 2 {
t.Fatal("should have saved 2 members")
}
Must(store.Channel().RemoveMember(o2.ChannelId, o2.UserId))
- count = (<-store.Channel().GetMemberCount(o1.ChannelId)).Data.(int64)
+ count = (<-store.Channel().GetMemberCount(o1.ChannelId, false)).Data.(int64)
if count != 1 {
t.Fatal("should have removed 1 member")
}
@@ -463,14 +473,14 @@ func TestChannelDeleteMemberStore(t *testing.T) {
t.Fatal("Member update time incorrect")
}
- count := (<-store.Channel().GetMemberCount(o1.ChannelId)).Data.(int64)
+ count := (<-store.Channel().GetMemberCount(o1.ChannelId, false)).Data.(int64)
if count != 2 {
t.Fatal("should have saved 2 members")
}
Must(store.Channel().PermanentDeleteMembersByUser(o2.UserId))
- count = (<-store.Channel().GetMemberCount(o1.ChannelId)).Data.(int64)
+ count = (<-store.Channel().GetMemberCount(o1.ChannelId, false)).Data.(int64)
if count != 1 {
t.Fatal("should have removed 1 member")
}
@@ -927,7 +937,7 @@ func TestGetMemberCount(t *testing.T) {
}
Must(store.Channel().SaveMember(&m1))
- if result := <-store.Channel().GetMemberCount(c1.Id); result.Err != nil {
+ if result := <-store.Channel().GetMemberCount(c1.Id, false); result.Err != nil {
t.Fatal("failed to get member count: %v", result.Err)
} else if result.Data.(int64) != 1 {
t.Fatal("got incorrect member count %v", result.Data)
@@ -947,7 +957,7 @@ func TestGetMemberCount(t *testing.T) {
}
Must(store.Channel().SaveMember(&m2))
- if result := <-store.Channel().GetMemberCount(c1.Id); result.Err != nil {
+ if result := <-store.Channel().GetMemberCount(c1.Id, false); result.Err != nil {
t.Fatal("failed to get member count: %v", result.Err)
} else if result.Data.(int64) != 2 {
t.Fatal("got incorrect member count %v", result.Data)
@@ -968,7 +978,7 @@ func TestGetMemberCount(t *testing.T) {
}
Must(store.Channel().SaveMember(&m3))
- if result := <-store.Channel().GetMemberCount(c1.Id); result.Err != nil {
+ if result := <-store.Channel().GetMemberCount(c1.Id, false); result.Err != nil {
t.Fatal("failed to get member count: %v", result.Err)
} else if result.Data.(int64) != 2 {
t.Fatal("got incorrect member count %v", result.Data)
@@ -989,7 +999,7 @@ func TestGetMemberCount(t *testing.T) {
}
Must(store.Channel().SaveMember(&m4))
- if result := <-store.Channel().GetMemberCount(c1.Id); result.Err != nil {
+ if result := <-store.Channel().GetMemberCount(c1.Id, false); result.Err != nil {
t.Fatal("failed to get member count: %v", result.Err)
} else if result.Data.(int64) != 2 {
t.Fatal("got incorrect member count %v", result.Data)