(t *testing.T)
| 57 | } |
| 58 | |
| 59 | func Test_makeInvitationsView(t *testing.T) { |
| 60 | mockInvitation := management.OrganizationInvitation{ |
| 61 | ID: pointer("invitation-id"), |
| 62 | Inviter: &management.OrganizationInvitationInviter{ |
| 63 | Name: pointer("inviter-name"), |
| 64 | }, |
| 65 | Invitee: &management.OrganizationInvitationInvitee{ |
| 66 | Email: pointer("invitee-email"), |
| 67 | }, |
| 68 | ExpiresAt: pointer("expires-at"), |
| 69 | ClientID: pointer("client-id"), |
| 70 | ConnectionID: pointer("connection-id"), |
| 71 | } |
| 72 | |
| 73 | view := makeInvitationsView(mockInvitation) |
| 74 | |
| 75 | assert.Equal(t, "invitation-id", view.ID) |
| 76 | assert.Equal(t, "client-id", view.ClientID) |
| 77 | assert.Equal(t, "inviter-name", view.InviterName) |
| 78 | assert.Equal(t, "invitee-email", view.InviteeEmail) |
| 79 | assert.Equal(t, "expires-at", view.ExpiresAt) |
| 80 | assert.Equal(t, "connection-id", view.ConnectionID) |
| 81 | assert.Equal(t, mockInvitation, view.raw) |
| 82 | } |
| 83 | |
| 84 | func pointer(s string) *string { |
| 85 | return &s |
nothing calls this directly
no test coverage detected