From 35b816b92217237de922c928a6623b5ac426655a Mon Sep 17 00:00:00 2001 From: enahum Date: Tue, 6 Sep 2016 15:48:43 -0300 Subject: PLT-3921 Fix System Console Recent Active Users (#3856) * PLT-3921 System Console Recent Active Users --- api/admin_test.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'api/admin_test.go') diff --git a/api/admin_test.go b/api/admin_test.go index 3d8a95676..7f3c584d8 100644 --- a/api/admin_test.go +++ b/api/admin_test.go @@ -527,3 +527,18 @@ func TestAdminLdapSyncNow(t *testing.T) { t.Fatal("Returned Failure") } } + +func TestGetRecentlyActiveUsers(t *testing.T) { + th := Setup().InitBasic() + + user1Id := th.BasicUser.Id + user2Id := th.BasicUser2.Id + + if userMap, err := th.BasicClient.GetRecentlyActiveUsers(th.BasicTeam.Id); err != nil { + t.Fatal(err) + } else if len(userMap.Data.(map[string]*model.User)) != 2 { + t.Fatal("should have been 2") + } else if userMap.Data.(map[string]*model.User)[user1Id].Id != user1Id || userMap.Data.(map[string]*model.User)[user2Id].Id != user2Id { + t.Fatal("should have been valid") + } +} -- cgit v1.2.3-1-g7c22