LG-9072 Applicant verify your information page "update state ID" workflows #8288
LG-9072 Applicant verify your information page "update state ID" workflows #8288gina-yamada merged 26 commits intomainfrom
Conversation
…applicant-update-workflows
Variables were recently renamed
…ur information page- update state ID workflow
…applicant-update-workflows
|
|
||
| describe '#updating_address effects on extra_view_variables.updating_address' do | ||
| let(:address1) { '123 Fourth St' } | ||
| let(:uuid) { '0000' } |
There was a problem hiding this comment.
we should delete this as it's not being used
| end | ||
|
|
||
| describe '#updating_address effects on extra_view_variables.updating_address' do | ||
| let(:address1) { '123 Fourth St' } |
There was a problem hiding this comment.
let's use the constant we have for address1 in this test: InPersonHelper::GOOD_ADDRESS1
| let(:pii_from_user) { flow.flow_session[:pii_from_user] } | ||
| let(:params) { ActionController::Parameters.new({ state_id: submitted_values }) } | ||
| let(:capture_secondary_id_enabled) { true } | ||
| let(:dob) { '1972-02-23' } |
There was a problem hiding this comment.
for lines 247-260 lets use the constants in the in_person_helper file
| and_return(enrollment) | ||
| end | ||
|
|
||
| # User picks "Yes, I live at the address on my state-issued ID" |
There was a problem hiding this comment.
can we break these comments up and put them in the test at the point were we're doing each behavior described?
eileen-nava
left a comment
There was a problem hiding this comment.
I left some thoughts. Please feel free to ask follow-up questions. Thanks! 🙏🏻
| end | ||
|
|
||
| if capture_secondary_id_enabled? | ||
| if (initial_state_of_same_address_as_id === 'true' && |
There was a problem hiding this comment.
I'd suggest making this syntax more Rubyesque by
- changing
===to== - removing the parentheses from the if statement on line 34
Right now, the syntax looks more like a JavaScript conditional statement.
There was a problem hiding this comment.
I’m interested in ways to keep this conditional logic readable and maintainable. What would you think about a refactor that uses nesting and helper methods, like…..
if capture_secondary_id_enabled?
if pii_from_user[:same_address_as_id] == 'true'
copy_state_id_address_to_residential_address(pii_from_user)
mark_step_complete(:address)
end
if initial_state_of_same_address_as_id === 'true' &&
pii_from_user[:same_address_as_id] === 'false'
clear_residential_address(pii_from_user)
mark_step_incomplete(:address)
end
endAnd then the helper methods could be defined further down....
private
def copy_state_id_address_to_residential_address
pii_from_user[:address1] = flow_params[:identity_doc_address1]
pii_from_user[:address2] = flow_params[:identity_doc_address2]
pii_from_user[:city] = flow_params[:identity_doc_city]
pii_from_user[:state] = flow_params[:identity_doc_address_state]
pii_from_user[:zipcode] = flow_params[:identity_doc_zipcode]
end
def clear_residential_address
pii_from_user.delete(:address1)
pii_from_user.delete(:address2)
pii_from_user.delete(:city)
pii_from_user.delete(:state)
pii_from_user.delete(:zipcode)
endIt might also be cute to have a one-liner method for flow_session[:pii_from_user][:same_address_as_id] == 'true', like state_id_address_and_residential_address_initially_same?. Although, yikes, that is a long method name! 😓 You could also make a method for initial_state_of_same_address_as_id == 'true' && pii_from_user[:same_address_as_id] == 'false', like state_id_address_and_address_diverge?. These are all suggestions and the method names are very rough draft. Let me know what you think! :)
| end | ||
| end | ||
|
|
||
| describe '#updating_address effects on extra_view_variables.updating_address' do |
There was a problem hiding this comment.
What would you think about combining these specs with the existing #extra_view_variables describe block in this file?
| end | ||
|
|
||
| before(:each) do | ||
| allow(IdentityConfig.store).to receive(:in_person_capture_secondary_id_enabled). |
There was a problem hiding this comment.
You can delete line 281. Lines 247 and 283 are sufficient setup.
| end | ||
| end | ||
|
|
||
| describe '#call' do |
There was a problem hiding this comment.
What do you think about combining this with the other #call describe block in this spec? Or changing this line so that there aren't two describe blocks with the same name in one file?
…applicant-update-workflows
There was a problem hiding this comment.
I recommend additionally testing the following cases in this file.
:same_address_as_idfield is not updated while DAV is enabled:same_address_as_idis set from'false'to'true'while DAV is enabled
spec/features/idv/in_person_spec.rb
Outdated
| complete_prepare_step(user) | ||
| end | ||
|
|
||
| it 'but does not update their previous selection of "Yes, |
There was a problem hiding this comment.
This is super tiny, but can you remove the 'but' from start of the test names? I keep reading it as "it but does not" and I get confused.
spec/features/idv/in_person_spec.rb
Outdated
| ) | ||
| end | ||
|
|
||
| it 'and updates their previous selection from "Yes" TO "No, I live at a different address"' do |
|
@18F/identity-joy-designers I did not take screenshots because it is really about the redirects here. I am happy to jump on a call and walk through each of the scenarios so that you can see the flow |
eileen-nava
left a comment
There was a problem hiding this comment.
This looks good to me. That being said, I think Jack and Tim had good points about testing.
kellular
left a comment
There was a problem hiding this comment.
Gina walked me through the scenarios in her local env. LGTM, thank you!
🎫 Ticket
LG-9072 Applicant verify your information page "update state ID" workflows
🛠 Summary of changes
I am making workflow updates only after the Verify your info page (only behind the in_person_capture_secondary_id_enabled feature flag) to capture different scenarios/flows a user might encounter related to state id address and their current residential address when a user selects Update on Verify your information for State-issued ID.
📜 Testing Plan
👀 Screenshots
You will need to walk through the flow to test this out so no screenshots