diff options
author | Martin Kraft <martinkraft@gmail.com> | 2018-05-09 15:00:07 -0400 |
---|---|---|
committer | Martin Kraft <martinkraft@gmail.com> | 2018-05-09 15:00:07 -0400 |
commit | d3e14a1bf86ac6148e09f888384cb46c61f23cdc (patch) | |
tree | 1c634c90166964f5184cb1ebd20ffb8ed209b120 /api4/system_test.go | |
parent | 60cf74352f13874a7d07c609c03b1c763af19cea (diff) | |
parent | c1853c7f40dd67c49524c8ea884ab61883a6abdd (diff) | |
download | chat-d3e14a1bf86ac6148e09f888384cb46c61f23cdc.tar.gz chat-d3e14a1bf86ac6148e09f888384cb46c61f23cdc.tar.bz2 chat-d3e14a1bf86ac6148e09f888384cb46c61f23cdc.zip |
Merge remote-tracking branch 'origin/master' into advanced-permissions-phase-2
Diffstat (limited to 'api4/system_test.go')
-rw-r--r-- | api4/system_test.go | 17 |
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) |