mirror of
https://github.com/go-gitea/gitea
synced 2024-11-19 00:11:24 +01:00
Add missing test case and fix typo in tests (#24915)
This PR adds a missing assertion in the `TestGetOrgUsersByOrgID` function. It also incidentally fixes a small typo.
This commit is contained in:
parent
2250ddd112
commit
63d5e762d8
2 changed files with 8 additions and 2 deletions
|
@ -265,6 +265,12 @@ func TestGetOrgUsersByOrgID(t *testing.T) {
|
||||||
UID: 4,
|
UID: 4,
|
||||||
IsPublic: false,
|
IsPublic: false,
|
||||||
}, *orgUsers[1])
|
}, *orgUsers[1])
|
||||||
|
assert.Equal(t, organization.OrgUser{
|
||||||
|
ID: orgUsers[2].ID,
|
||||||
|
OrgID: 3,
|
||||||
|
UID: 28,
|
||||||
|
IsPublic: true,
|
||||||
|
}, *orgUsers[2])
|
||||||
}
|
}
|
||||||
|
|
||||||
orgUsers, err = organization.GetOrgUsersByOrgID(db.DefaultContext, &organization.FindOrgMembersOpts{
|
orgUsers, err = organization.GetOrgUsersByOrgID(db.DefaultContext, &organization.FindOrgMembersOpts{
|
||||||
|
|
|
@ -85,7 +85,7 @@ func TestUserListIsPublicMember(t *testing.T) {
|
||||||
{22, map[int64]bool{}},
|
{22, map[int64]bool{}},
|
||||||
}
|
}
|
||||||
for _, v := range tt {
|
for _, v := range tt {
|
||||||
t.Run(fmt.Sprintf("IsPublicMemberOfOrdIg%d", v.orgid), func(t *testing.T) {
|
t.Run(fmt.Sprintf("IsPublicMemberOfOrgId%d", v.orgid), func(t *testing.T) {
|
||||||
testUserListIsPublicMember(t, v.orgid, v.expected)
|
testUserListIsPublicMember(t, v.orgid, v.expected)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -112,7 +112,7 @@ func TestUserListIsUserOrgOwner(t *testing.T) {
|
||||||
{22, map[int64]bool{}}, // No member
|
{22, map[int64]bool{}}, // No member
|
||||||
}
|
}
|
||||||
for _, v := range tt {
|
for _, v := range tt {
|
||||||
t.Run(fmt.Sprintf("IsUserOrgOwnerOfOrdIg%d", v.orgid), func(t *testing.T) {
|
t.Run(fmt.Sprintf("IsUserOrgOwnerOfOrgId%d", v.orgid), func(t *testing.T) {
|
||||||
testUserListIsUserOrgOwner(t, v.orgid, v.expected)
|
testUserListIsUserOrgOwner(t, v.orgid, v.expected)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue