summaryrefslogtreecommitdiffstats
path: root/api/team_test.go
diff options
context:
space:
mode:
authorCarlos Tadeu Panato Junior <ctadeu@gmail.com>2016-12-20 16:55:22 +0100
committerCorey Hulen <corey@hulen.com>2016-12-20 07:55:22 -0800
commitb9092ca2f56b0fa2b8ec7719c2ec5cfe5a21a6c9 (patch)
treef9d8a0aee0937acca727786db077fa38039304db /api/team_test.go
parent92b2810d84bda78b87f23d5e3d8d04de1c3d9125 (diff)
downloadchat-b9092ca2f56b0fa2b8ec7719c2ec5cfe5a21a6c9.tar.gz
chat-b9092ca2f56b0fa2b8ec7719c2ec5cfe5a21a6c9.tar.bz2
chat-b9092ca2f56b0fa2b8ec7719c2ec5cfe5a21a6c9.zip
Fix API Get channels for a user returns users' dm channels with blank teamid (#4748)
* fix API Get channels for a user returns users' dm channels with blank team ID add check in the context.go add suggestion made adjustment per review and support from @joram * update tests * add check if needd user or admin permissions * update per review
Diffstat (limited to 'api/team_test.go')
-rw-r--r--api/team_test.go12
1 files changed, 4 insertions, 8 deletions
diff --git a/api/team_test.go b/api/team_test.go
index c4bcb1868..52b23e1ba 100644
--- a/api/team_test.go
+++ b/api/team_test.go
@@ -766,15 +766,11 @@ func TestGetTeamStats(t *testing.T) {
}
}
- if result, err := th.SystemAdminClient.GetTeamStats("junk"); err != nil {
- t.Fatal(err)
+ if _, err := th.SystemAdminClient.GetTeamStats("junk"); err == nil {
+ t.Fatal("should fail invalid teamid")
} else {
- if result.Data.(*model.TeamStats).TotalMemberCount != 0 {
- t.Fatal("wrong count")
- }
-
- if result.Data.(*model.TeamStats).ActiveMemberCount != 0 {
- t.Fatal("wrong count")
+ if err.Id != "store.sql_team.get.find.app_error" {
+ t.Fatal("wrong error. Got: " + err.Id)
}
}