-
Notifications
You must be signed in to change notification settings - Fork 1
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
Mpdx 8163 fix phone numbers input lag #1082
Conversation
Preview branch generated at https://MPDX-8163-fix-phone-numbers-input-lag.d3dytjb8adxkk5.amplifyapp.com |
Bundle sizes [mpdx-react]Compared against a536cc4
|
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.
266833d
to
cbee27d
Compare
@wjames111 Everything is marked resolved, but did you make any changes? I looked at a few of the items, and it looks like it did when I reviewed last time. |
@canac hmmm that's odd, I just rebased maybe I messed something up. |
@@ -124,53 +115,66 @@ const FixPhoneNumbers: React.FC<Props> = ({ | |||
}: Props) => { | |||
const { classes } = useStyles(); | |||
const { enqueueSnackbar } = useSnackbar(); | |||
const { appName } = useGetAppSettings(); | |||
const appName = process.env.APP_NAME ?? 'MPDX'; |
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.
I think useGetAppSettings
is a better way of doing this. Was there a reason you switched?
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.
I noticed Fix Mailing Addresses was doing it this way, and I was trying to model off that tool as closely as possible as they're pretty similar.
fireEvent.change(getByTestId('source-select'), { | ||
target: { value: 'MPDX' }, | ||
}); |
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.
I think this could use userEvent.click
also. You probably have to click on source-select
and then click on getByRole('option', { name: "Item name" })
.
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.
So only issue with this is I'm getting, "unable to click element as it has or inherits pointer-events set to 'none'." Not sure the best way to get around 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.
Is the selectbox disabled?
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.
It doesn't appear to be
<Select
className={classes.select}
inputProps={{ 'data-testid': 'source-select' }}
value={defaultSource}
onChange={(event: SelectChangeEvent) =>
handleSourceChange(event)
}
size="small"
>
{sourceOptions.map((source) => (
<MenuItem
key={source}
value={source}
data-testid="select-option"
>
{source}
</MenuItem>
))}
</Select>
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.
Oh, the input has aria-hidden="true"
on it. I think what you want to do is put the select and the "Default Primary Source" label in a <FormControl>
like here. That will be better for accessibility too because "Default Primary Source" will be associated with the select box. Then in the test you can find it with getByRole('combobox', { name: 'Default Primary Source '})
.
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.
Nice this works, It does change the style of it a good amount. I think it works better though and like you said, it's more accessable. My only concern is it not looking like the other tools. Do you think I should wrap the bulk select with FormControl
on the others as well?
</Select> | ||
<Box className={classes.defaultBox}> | ||
<FormControl size="small"> | ||
<InputLabel shrink id="source-select" size="small"> |
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.
Thanks for making this a FormControl
! Looks like two elements have the id source-select
and ids are supposed to be unique. You can probably remove them both unless you know of a reason to keep them. Also, I don't think that inputProps={{ 'data-testid': 'source-select' }}
is needed anymore since we are finding the select input by its role.
userEvent.click(primarySource); | ||
userEvent.click(getByRole('option', { name: 'MPDX' })); | ||
|
||
expect(getByTestId('source-select')).toHaveValue('MPDX'); |
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.
expect(getByTestId('source-select')).toHaveValue('MPDX'); | |
expect(primarySource).toHaveValue('MPDX'); |
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.
Getting undefined here for some reason.
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.
Honestly, I was also thinking that you could remove this line of the test. A more useful test could be to check that the confirm button as the text "Confirm 52 as MPDX". And I just realized that if "MPDX" is the initial value of that combobox, it would be better to select a different option so that the value actually changes. I feel like I'm stringing you along in asking for changes to the tests, but I promise that's not my intention.
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.
Hahah no you're fine. I'd like to make it as good as I can. So your feedback is needed.
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.
I'm going to approve since my last two suggests are very minor. Great work with all of these improvements!
98bc3cd
to
e2ced21
Compare
Description
Tickets
Description of Each Ticket
Checklist: