-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add assigned by user details to grants assigned to agencies endpoint #3164
Add assigned by user details to grants assigned to agencies endpoint #3164
Conversation
QA Summary
Test CoverageCoverage report for `packages/client`
Coverage report for `packages/server`
|
Terraform Summary
Hint: If "Terraform Format & Style" failed, run OutputValidation Output
Plan Summary
Pusher: @thucdtran, Action: |
…ls-in-assigned-agencies-endpoint
…ucdtran/assign-to-share-include-user-details-in-assigned-agencies-endpoint
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looks great! I've got a couple thoughts on tests in the comments, but honestly they're not strongly held opinions and you can consider them non-blocking if you'd prefer to merge as-is.
@@ -143,6 +156,10 @@ describe('`/api/grants` endpoint', () => { | |||
const badResponse = await fetchApi(`/grants/${assignedEndpoint}`, agencies.offLimits, fetchOptions.admin); | |||
expect(badResponse.statusText).to.equal('Forbidden'); | |||
}); | |||
it('includes assigned by information for the grant to an agency', async () => { | |||
expect(json.find((a) => a.assigned_by_name === assignedBy.NV1.assigned_by_name)).to.be.ok; | |||
expect(json.find((a) => a.assigned_by_name === assignedBy.NV2.assigned_by_name)).to.be.ok; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems worth testing the other fields are present too. Can we verify that name, email, and avatar color are all as expected?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done here as well!
@@ -41,6 +41,19 @@ describe('`/api/grants` endpoint', () => { | |||
}, | |||
}; | |||
|
|||
const assignedBy = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Presumably this is pulled out here since it's used in both the tests you've added. I'd love to see it moved a bit closer to the code that uses it, like just within the closest common context
block.
Another angle to consider (warning: personal opinion, feel free to disregard if you disagree!)... I actually find denormalizing this and just writing it out in each test is often easier to read and work with. If it's repeated a ton of times, then yeah, I'd pull it out, but if it's incidentally the same across two tests, I actually lean slightly toward just writing it out both times inline. There's a big benefit to keeping tests simple and easy to read.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done here.
…ucdtran/assign-to-share-include-user-details-in-assigned-agencies-endpoint
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
…ls-in-assigned-agencies-endpoint
Ticket #3072
Description
Adds the following fields to
/api/organizations/[organization ID]/grants/[grant ID]/assign/agencies
endpoint.assigned_by_name
assigned_by_avatar_color
assigned_by_email
Screenshots / Demo Video
Testing
Added unit tests to check that we are returning new fields.
Manual testing can be done by checking to see what the agencies object in the assign-to-share feature is listed as for the grant detail page.
Checklist