diff options
author | Philip Peterson <philip-peterson@users.noreply.github.com> | 2023-05-24 15:06:04 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-24 21:06:04 +0200 |
commit | 63d5e762d8813881bd7449ac5c05ae95cc3a93eb (patch) | |
tree | b1246a416c30774f62ff20585d888c9c92546051 /models/organization | |
parent | 2250ddd112d73f4210be588077ac8127229dcacc (diff) | |
download | gitea-63d5e762d8813881bd7449ac5c05ae95cc3a93eb.tar.gz gitea-63d5e762d8813881bd7449ac5c05ae95cc3a93eb.zip |
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.
Diffstat (limited to 'models/organization')
-rw-r--r-- | models/organization/org_test.go | 6 | ||||
-rw-r--r-- | models/organization/org_user_test.go | 4 |
2 files changed, 8 insertions, 2 deletions
diff --git a/models/organization/org_test.go b/models/organization/org_test.go index 6e58387997..27e124a62b 100644 --- a/models/organization/org_test.go +++ b/models/organization/org_test.go @@ -265,6 +265,12 @@ func TestGetOrgUsersByOrgID(t *testing.T) { UID: 4, IsPublic: false, }, *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{ diff --git a/models/organization/org_user_test.go b/models/organization/org_user_test.go index edd0aa3ea0..b6477f859c 100644 --- a/models/organization/org_user_test.go +++ b/models/organization/org_user_test.go @@ -85,7 +85,7 @@ func TestUserListIsPublicMember(t *testing.T) { {22, map[int64]bool{}}, } 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) }) } @@ -112,7 +112,7 @@ func TestUserListIsUserOrgOwner(t *testing.T) { {22, map[int64]bool{}}, // No member } 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) }) } |