-
Notifications
You must be signed in to change notification settings - Fork 357
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
test, upcoming: [M3-7134, M3-7314] - Add integration test for AGLB Edit Certificate flow and improve form validation #9880
test, upcoming: [M3-7134, M3-7314] - Add integration test for AGLB Edit Certificate flow and improve form validation #9880
Conversation
{!certificate ? ( | ||
<Notice variant="error">Error loading certificate.</Notice> | ||
) : ( | ||
<form onSubmit={formik.handleSubmit}> | ||
{errorMap.none && <Notice text={errorMap.none} variant="error" />} |
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.
Somehow an extra error notice had slipped in originally -- cleaned this up here.
validateOnBlur: !error, | ||
validateOnChange: !error, |
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.
Following suit with what we did in another edit drawer even though this doesn't look as nice, it seems better than have disappearing errors if a user were to clear the label and update the cert, but not provide a key (see PR description video).
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.
Changes look great! Thanks for all of the tests too 🧪
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.
Looks good! Confirmed everything listed, just had one small comment below.
(Edit: not sure why GitHub isn't showing the rest of my comment, so I'll just put the checks here above the video
Confirmed that all tests pass! ✅
Confirmed that error appears! ✅
Confirmed previous validation: ✅
- ✅ A user can edit just the form label, and the form will submit. The certificate will be excluded from the payload since it has not changed.
- ✅ A user can edit just the key, and the form will submit. The existing certificate will be included in the payload, since updating a key requires a cert.
- ✅ A user cannot edit just the cert and will see a validation error on Private Key. This is invalid because updating a cert requires a key, and API does not return the key for security.
- ✅ A user can edit both the cert and the key, and the form will submit. Both the edited cert and edited key will be in the payload.)
Could we add a scroll to error, especially for the forms that have the Private Key field?
Screen.Recording.2023-11-07.at.10.45.36.AM.mov
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.
Integration test passes ✅
"Label must not be empty" validation error when attempting to submit an edited cert with no label ✅
Edit just the form label, and the form will submit. The certificate will be excluded from the payload since it has not changed. ✅
Edit just the key, and the form will submit. The existing certificate will be included in the payload, since updating a key requires a cert. ✅
Cannot edit just the cert. See a validation error on Private Key. ✅
Can edit both the cert and the key, and the form will submit. Both the edited cert and edited key are in the payload. ✅
@coliu-akamai Good call out for smaller screens! I implemented scroll-into-view for the Edit drawer in 423e64c. Screen.Recording.2023-11-07.at.3.00.23.PM.movSince we'd want the same behavior in the Create drawer, so I made the change there too. (Also noticed that the Create drawer is not an expanded width, which is a bad UX when the user pastes long certs, so I adjusted in 7624cec. Not very evident in the screencap because I squished my viewport to get the drawer to scroll.) Screen.Recording.2023-11-07.at.3.01.04.PM.mov |
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.
awesome, thanks Mariah! 🎉
Description 📝
This PR does two things, because fixing the validation was necessary for writing a complete integration test that confirmed all input errors were handled gracefully.
Changes 🔄
Integration tests in
load-balancer-certificates.spec.ts
test the following:In the Cloud Manager UI:
Preview 📷
Screen.Recording.2023-11-06.at.3.12.03.PM.mov
Screen.Recording.2023-11-06.at.3.10.57.PM.mov
How to test 🧪
Prerequisites
(How to setup test environment)
aglb
feature flag is on and turn mocks on.Reproduction steps
(How to reproduce the issue, if applicable)
develop
....
) to select the Edit action and open the Edit Certificate drawer.label
field.Verification steps
(How to verify changes)
...
) to select the Edit action and open the Edit Certificate drawer.label
field.Label must not be empty
and the form will not submit until a label is provided.Also confirm the following validation still works as expected by checking the request payload:
Confirm the integration test passes:
As an Author I have considered 🤔
Check all that apply