-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
fix(auth): update FetchDevicesOutput output type to include name attribute #14186
fix(auth): update FetchDevicesOutput output type to include name attribute #14186
Conversation
@@ -81,7 +81,23 @@ describe('fetchDevices', () => { | |||
}); | |||
|
|||
it('should fetch devices and parse client response correctly', async () => { | |||
expect(await fetchDevices()).toEqual([apiOutputDevice]); | |||
const { |
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.
we should probably update all API unit tests to
- use a wrapper to catch input type issues
- destructure result object to catch output type issues
(reference)
@@ -77,7 +77,7 @@ const parseDevicesResponse = async ( | |||
{}, | |||
); | |||
|
|||
return { | |||
const result: AWSAuthDevice = { |
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.
nit: could be
devices.map<AWSAuthDevice>()
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.
Nvm by this 👀
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.
tried this as well but TS only enforces mandatory keys
Description of changes
name
attribute to fetchDevices API's return type FetchDevicesOutputIssue #, if available
#14178
Description of how you validated changes
Before


After
Checklist
yarn test
passesChecklist for repo maintainers
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.