LG-7241: Handle errors when creating USPS enrollment#6629
Conversation
…creating USPS enrollment
NavaTim
left a comment
There was a problem hiding this comment.
Reviewing before WIP removed to help speed things along.
Seems like the following AC is already handled by #6624, but maybe @sheldon-b or @tomas-nava should confirm.
Coordinate with the engineer working on LG-6089 if necessary to establish a consistent format for saving the Post Office address to the session and database; then make sure that the work for LG-6348 (PR #6580) is modified to display the address format correctly.
…stein/lg-6872-add-error-handling
Fixed the specs for password confirm controller
aduth
left a comment
There was a problem hiding this comment.
Looks like there's a couple failures in the build (missing fixture file?), but otherwise LGTM 👍
| address = [pii['address1'], pii['address2']].select(&:present?).join(' ') | ||
| applicant = UspsInPersonProofing::Applicant.new( | ||
| { | ||
| unique_id: enrollment.usps_unique_id, | ||
| first_name: pii['first_name'], | ||
| last_name: pii['last_name'], | ||
| address: pii['address1'], | ||
| # do we need address2? | ||
| address: address, |
There was a problem hiding this comment.
Based on some of the testing feedback we've received, I'm hopeful this change may help fix some issues we've seen with apartment / unit numbers!
| @@ -1,26 +1,36 @@ | |||
| require './spec/support/usps_ipp_fixtures' | |||
There was a problem hiding this comment.
It catches my attention that we're loading spec code from the app code, vs. the other way around. I suppose it's probably not an issue? The alternative could be to move the mock data somewhere in this folder (e.g. app/services/usps_in_person_proofing/mock/responses/request_facilities.json), but I also don't see much prior art for that, so could leave it as-is.
There was a problem hiding this comment.
(Only after I wrote this did I notice you already self-reported at #6629 (comment) 😄 )
There was a problem hiding this comment.
I like the idea of having a file in mock/ for this, it does feel weird to be pulling in a spec fixture.
There was a problem hiding this comment.
Okay, I moved things around in baff25e
- Move all of the response json files to app/services/usps_in_person_proofing/mock/responses/
- Move the UspsIppFixtures class to UspsInPersonProofing::Mock::Fixtures
- Update all of the references to the fixtures to the new class
📋 Changes
📺 Demo
FSM v1 password confirm page
Note: when the user encounters this error the page is reloaded and their password is cleared from the form
FSM v2 password confirm page
Client error log example
🔍 Testing instructions
You can try this out locally by setting
usps_mock_fallbacktotruein yourapplication.yml.defaultfile and using one of the special first names to trigger a particular error:You can switch between fsm v1 and fsm v2 by changing the value of
idv_api_enabled_stepsin yourapplication.yml.defaultfile:'[]''["password_confirm", "personal_key","personal_key_confirm"]'