Skip to content

Commit 68081c4

Browse files
lunnyGiteaBot
andauthored
Add test for api team orgnization (#24699)
Co-authored-by: Giteabot <[email protected]>
1 parent 8a8b753 commit 68081c4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/integration/api_team_test.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ func TestAPITeam(t *testing.T) {
2929

3030
teamUser := unittest.AssertExistsAndLoadBean(t, &organization.TeamUser{ID: 1})
3131
team := unittest.AssertExistsAndLoadBean(t, &organization.Team{ID: teamUser.TeamID})
32+
org := unittest.AssertExistsAndLoadBean(t, &organization.Organization{ID: teamUser.OrgID})
3233
user := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: teamUser.UID})
3334

3435
session := loginUser(t, user.Name)
@@ -40,6 +41,7 @@ func TestAPITeam(t *testing.T) {
4041
DecodeJSON(t, resp, &apiTeam)
4142
assert.EqualValues(t, team.ID, apiTeam.ID)
4243
assert.Equal(t, team.Name, apiTeam.Name)
44+
assert.EqualValues(t, convert.ToOrganization(db.DefaultContext, org), apiTeam.Organization)
4345

4446
// non team member user will not access the teams details
4547
teamUser2 := unittest.AssertExistsAndLoadBean(t, &organization.TeamUser{ID: 3})
@@ -58,7 +60,7 @@ func TestAPITeam(t *testing.T) {
5860
session = loginUser(t, user.Name)
5961
token = getTokenForLoggedInUser(t, session, auth_model.AccessTokenScopeAdminOrg)
6062

61-
org := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: 6})
63+
org = unittest.AssertExistsAndLoadBean(t, &organization.Organization{ID: 6})
6264

6365
// Create team.
6466
teamToCreate := &api.CreateTeamOption{

0 commit comments

Comments
 (0)