-
Notifications
You must be signed in to change notification settings - Fork 364
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
change: [M3-7740] - Use "default" for non-parent/proxy/child user_type
instead of null
#10176
change: [M3-7740] - Use "default" for non-parent/proxy/child user_type
instead of null
#10176
Conversation
@@ -40,7 +36,6 @@ describe('Account login history', () => { | |||
restricted: false, | |||
}); | |||
|
|||
mockGetAccount(mockAccount).as('getAccount'); |
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.
Unrelated to the user_type
change: we didn't actually need to mock GET account
in these login history specs, so it's been removed.
const companyName = | ||
(hasParentChildAccountAccess && | ||
profile?.user_type !== 'default' && | ||
account?.company) ?? | ||
''; |
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 was the fix for the user menu that would have displayed the company name for regular users, without explicitly checking now that the user_type isn't default
.
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.
Looking good 👍
Description 📝
API has changed the
user_type
for regular (non parent/child/proxy) users to return "default" rather thannull
.Since we've been basing our mocks off of a
null
user_type, this API update required some refactoring in the UI, as well as updates to tests (unit and Cypress).Changes 🔄
user_type
intypes.ts
apiv4 files to include"default"
instead ofnull
a valid valueuser_type: null
or used nullish coalescing to display UI components to a "regular" (non-parent/proxy/child) user.Preview 📷
How to test 🧪
Prerequisites
(How to setup test environment)
yarn up
.Reproduction steps
(How to reproduce the issue, if applicable)
yarn up
.user_type
inserverHandlers.ts
tonull
.Mock Company
is displayed below the username.Verification steps
(How to verify changes)
user_type
inserverHandlers.ts
todefault
.Mock Company
is not displayed below the username."default"
) users. (http://localhost:3000/account/settings)As an Author I have considered 🤔
Check all that apply