коммит произвёл
GitHub
родитель
f42d3c83f3
Коммит
1c498996a4
@@ -572,13 +572,16 @@ func TestGetAllTeams(t *testing.T) {
|
||||
CheckNoError(t, resp)
|
||||
|
||||
testCases := []struct {
|
||||
Name string
|
||||
Page int
|
||||
PerPage int
|
||||
Permissions []string
|
||||
ExpectedTeams []string
|
||||
WithCount bool
|
||||
ExpectedCount int64
|
||||
Name string
|
||||
Page int
|
||||
PerPage int
|
||||
Permissions []string
|
||||
ExpectedTeams []string
|
||||
WithCount bool
|
||||
ExpectedCount int64
|
||||
ExpectedError bool
|
||||
ErrorId string
|
||||
ExpectedStatusCode int
|
||||
}{
|
||||
{
|
||||
Name: "Get 1 team per page",
|
||||
@@ -623,11 +626,23 @@ func TestGetAllTeams(t *testing.T) {
|
||||
ExpectedTeams: []string{th.BasicTeam.Id, team1.Id, team2.Id, team3.Id, team4.Id},
|
||||
},
|
||||
{
|
||||
Name: "Get no teams because permissions",
|
||||
Page: 0,
|
||||
PerPage: 10,
|
||||
Permissions: []string{},
|
||||
ExpectedTeams: []string{},
|
||||
Name: "Get no teams because permissions",
|
||||
Page: 0,
|
||||
PerPage: 10,
|
||||
Permissions: []string{},
|
||||
ExpectedError: true,
|
||||
ExpectedStatusCode: http.StatusForbidden,
|
||||
ErrorId: "api.team.get_all_teams.insufficient_permissions",
|
||||
},
|
||||
{
|
||||
Name: "Get no teams because permissions with count",
|
||||
Page: 0,
|
||||
PerPage: 10,
|
||||
Permissions: []string{},
|
||||
WithCount: true,
|
||||
ExpectedError: true,
|
||||
ExpectedStatusCode: http.StatusForbidden,
|
||||
ErrorId: "api.team.get_all_teams.insufficient_permissions",
|
||||
},
|
||||
{
|
||||
Name: "Get all teams with count",
|
||||
@@ -679,6 +694,11 @@ func TestGetAllTeams(t *testing.T) {
|
||||
} else {
|
||||
teams, resp = Client.GetAllTeams("", tc.Page, tc.PerPage)
|
||||
}
|
||||
if tc.ExpectedError {
|
||||
CheckErrorMessage(t, resp, tc.ErrorId)
|
||||
checkHTTPStatus(t, resp, tc.ExpectedStatusCode, true)
|
||||
return
|
||||
}
|
||||
CheckNoError(t, resp)
|
||||
require.Equal(t, len(tc.ExpectedTeams), len(teams))
|
||||
for idx, team := range teams {
|
||||
|
||||
Ссылка в новой задаче
Block a user