Skip to content

Commit

Permalink
test: add role_name to test respone
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasLopes7 committed Oct 14, 2024
1 parent 0b6281d commit ed16c05
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 3 additions & 1 deletion organizationinvitation/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ func TestOrganizationInvitationClientGet(t *testing.T) {
config.HTTPClient = &http.Client{
Transport: &clerktest.RoundTripper{
T: t,
Out: json.RawMessage(fmt.Sprintf(`{"id":"%s","object":"organization_invitation","email_address":"string","role":"string","organization_id":"%s","status":"string","public_metadata":{},"private_metadata":{},"created_at":0,"updated_at":0}`, id, organizationID)),
Out: json.RawMessage(fmt.Sprintf(`{"id":"%s","object":"organization_invitation","email_address":"string","role":"string","role_name":"string","organization_id":"%s","status":"string","public_metadata":{},"private_metadata":{},"created_at":0,"updated_at":0}`, id, organizationID)),
Method: http.MethodGet,
Path: "/v1/organizations/" + organizationID + "/invitations/" + id,
},
Expand All @@ -144,6 +144,8 @@ func TestOrganizationInvitationClientGet(t *testing.T) {
require.NoError(t, err)
require.Equal(t, id, response.ID)
require.Equal(t, organizationID, response.OrganizationID)
require.Equal(t, "string", response.RoleName)
require.Equal(t, "string", response.Role)
}

func TestOrganizationInvitationClientGet_Error(t *testing.T) {
Expand Down
6 changes: 5 additions & 1 deletion organizationmembership/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,9 @@ func TestOrganizationMembershipClientList(t *testing.T) {
"data": [{
"id":"%s",
"organization":{"id":"%s"},
"public_user_data":{"user_id":"%s"}
"public_user_data":{"user_id":"%s"},
"role": "string",
"role_name": "string",
}],
"total_count": 1
}`,
Expand Down Expand Up @@ -204,4 +206,6 @@ func TestOrganizationMembershipClientList(t *testing.T) {
require.Equal(t, id, list.OrganizationMemberships[0].ID)
require.Equal(t, organizationID, list.OrganizationMemberships[0].Organization.ID)
require.Equal(t, userID, list.OrganizationMemberships[0].PublicUserData.UserID)
require.Equal(t, "string", list.OrganizationMemberships[0].RoleName)
require.Equal(t, "string", list.OrganizationMemberships[0].Role)
}

0 comments on commit ed16c05

Please sign in to comment.