Skip to content

LG-10452 Improve Validation on Full Address Form#9008

Merged
gina-yamada merged 39 commits intomainfrom
yamada/LG-10452-ImproveValidationOnFullAddressForm
Aug 28, 2023
Merged

LG-10452 Improve Validation on Full Address Form#9008
gina-yamada merged 39 commits intomainfrom
yamada/LG-10452-ImproveValidationOnFullAddressForm

Conversation

@gina-yamada
Copy link
Contributor

@gina-yamada gina-yamada commented Aug 15, 2023

🎫 Ticket

LG-10452 Improve validation on PO search full address form

🛠 Summary of changes

Improved Validation on Full Address Form:

  • Display validation error when only spaces/tabs are entered in any field (Address, City, State, Zip Code) after the Search button is clicked (not on change)
  • Removal leading/trailing white space for all fields (Address, City, State, Zip Code) being sent to USPS
  • Add validation error message for zip code when there is a pattern mismatch (when not 5 digits)
  • Address has a max length of 255 characters, city has a max length of 50, and zip code has a max length of 5

📜 Testing Plan

  • Step 1 Set in_person_full_address_entry_enabled to true in application.yml (if testing locally)-- All updates made to the Find a participating Post Office long form at /verify/document_capture#location. You will know you are on the long form if you can see an input field for Address, City, ZIP Code, and a drop down box for State. You will be taken there automatically after you fail proofing if you choose In Person Proofing and the flag in step 1 has been turned on.
  • Step 2 (optional) You can set usps_ipp_ variables in application.yml to hit USPS dev (if testing locally) to get actual results rather than mock data if you want to see it in action.
  • Step 3 Create an account. Set up password and authentication. Get started and upload images to fail proofing. Try in person
  • Step 4 Move through the flow until you land on Find a participating Post Office (url: verify/document_capture#location)
  • Step 5 Enter only spaces/tabs as the input for Address, City, and ZIP Code. Hit the Search button. You should observe a validation error (This field is required). You should be stuck on the page and should not be able to move forward.
  • Step 6 Enter a ZIP Code that does not contain 5 numbers (that is not empty). You will get a validation error- Enter a 5 ZIP Code
  • Step 7 You can test out max length by typing more characters than allowed. No additional input will be captured. (address = 255, city = 50, zip code = 5)
  • Step 8 Check validation messages (This field is required & Enter a 5 digit ZIP Code) in English, Spanish, and French

📷 Screenshots

Screenshot 2023-08-25 at 8 20 42 AM

Screenshot 2023-08-25 at 8 21 17 AM

Screenshot 2023-08-25 at 9 26 05 AM

Screenshot 2023-08-25 at 9 45 26 AM

@gina-yamada gina-yamada marked this pull request as ready for review August 17, 2023 15:51
@gina-yamada gina-yamada requested review from a team and svalexander and removed request for svalexander August 17, 2023 21:19
@gina-yamada
Copy link
Contributor Author

@aduth Thanks for the review! Good point about just having unique change handler functions to handle each input rather than if/else logic.

@gina-yamada gina-yamada requested review from a team, NavaTim, rutvigupta-design and sheldon-b and removed request for a team August 24, 2023 19:17
@gina-yamada
Copy link
Contributor Author

Other than translations- this PR can be reviewed/tested again. Thank you!

@allthesignals allthesignals self-requested a review August 25, 2023 19:14
@gina-yamada gina-yamada removed the request for review from rutvigupta-design August 25, 2023 20:14
@gina-yamada gina-yamada merged commit e74a60e into main Aug 28, 2023
@gina-yamada gina-yamada deleted the yamada/LG-10452-ImproveValidationOnFullAddressForm branch August 28, 2023 14:25
@mdiarra3 mdiarra3 mentioned this pull request Aug 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants