summaryrefslogtreecommitdiffstats
path: root/api4/system_test.go
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2018-05-02 10:50:56 -0400
committerChristopher Speller <crspeller@gmail.com>2018-05-02 07:50:56 -0700
commitd6537deb3ddace25b693932ae503b4fbdbe02935 (patch)
tree64b3f9989e43459cfc815076fe460920a8796abe /api4/system_test.go
parent1647614fc95b0cb9dd5c4c5699f4f7fbba0bee43 (diff)
downloadchat-d6537deb3ddace25b693932ae503b4fbdbe02935.tar.gz
chat-d6537deb3ddace25b693932ae503b4fbdbe02935.tar.bz2
chat-d6537deb3ddace25b693932ae503b4fbdbe02935.zip
Add inactive user count to analytics and fix client analytics function (#8695)
Diffstat (limited to 'api4/system_test.go')
-rw-r--r--api4/system_test.go17
1 files changed, 13 insertions, 4 deletions
diff --git a/api4/system_test.go b/api4/system_test.go
index c0fde6c39..d4134f8e2 100644
--- a/api4/system_test.go
+++ b/api4/system_test.go
@@ -512,15 +512,18 @@ func TestGetAnalyticsOld(t *testing.T) {
CheckNoError(t, resp)
found := false
+ found2 := false
for _, row := range rows {
if row.Name == "unique_user_count" {
found = true
+ } else if row.Name == "inactive_user_count" {
+ found2 = true
+ assert.True(t, row.Value >= 0)
}
}
- if !found {
- t.Fatal("should return unique user count")
- }
+ assert.True(t, found, "should return unique user count")
+ assert.True(t, found2, "should return inactive user count")
_, resp = th.SystemAdminClient.GetAnalyticsOld("post_counts_day", "")
CheckNoError(t, resp)
@@ -531,9 +534,15 @@ func TestGetAnalyticsOld(t *testing.T) {
_, resp = th.SystemAdminClient.GetAnalyticsOld("extra_counts", "")
CheckNoError(t, resp)
- _, resp = th.SystemAdminClient.GetAnalyticsOld("", th.BasicTeam.Id)
+ rows, resp = th.SystemAdminClient.GetAnalyticsOld("", th.BasicTeam.Id)
CheckNoError(t, resp)
+ for _, row := range rows {
+ if row.Name == "inactive_user_count" {
+ assert.Equal(t, float64(-1), row.Value, "inactive user count should be -1 when team specified")
+ }
+ }
+
rows2, resp2 := th.SystemAdminClient.GetAnalyticsOld("standard", "")
CheckNoError(t, resp2)
assert.Equal(t, "total_websocket_connections", rows2[5].Name)