Skip to content

Commit

Permalink
LG-13657 - Prep to remove IPP FSM, set controller feature flag in test
Browse files Browse the repository at this point in the history
changelog: Internal, In-person proofing, Set state id controller feature flag to true in test
  • Loading branch information
jennyverdeyen committed Sep 11, 2024
1 parent 3fc5783 commit 0ee4561
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 20 deletions.
1 change: 1 addition & 0 deletions config/application.yml.default
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,7 @@ test:
hmac_fingerprinter_key: a2c813d4dca919340866ba58063e4072adc459b767a74cf2666d5c1eef3861db26708e7437abde1755eb24f4034386b0fea1850a1cb7e56bff8fae3cc6ade96c
hmac_fingerprinter_key_queue: '["old-key-one", "old-key-two"]'
identity_pki_disabled: true
in_person_state_id_controller_enabled: true
lexisnexis_trueid_account_id: 'test_account'
lockout_period_in_minutes: 5
logins_per_email_and_ip_limit: 2
Expand Down
5 changes: 5 additions & 0 deletions spec/controllers/idv/in_person/address_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@
end

context 'in_person_state_id_controller_enabled is not enabled' do
before do
allow(IdentityConfig.store).to receive(:in_person_state_id_controller_enabled).
and_return(false)
end

it 'redirects to state id page if not complete' do
subject.user_session['idv/in_person'][:pii_from_user].delete(:identity_doc_address1)
get :show
Expand Down
4 changes: 2 additions & 2 deletions spec/controllers/idv/in_person_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
it 'redirects to the first step' do
get :index

expect(response).to redirect_to idv_in_person_step_url(step: :state_id)
expect(response).to redirect_to idv_in_person_proofing_state_id_path
end

it 'has non-nil presenter' do
Expand All @@ -82,7 +82,7 @@
it 'redirects to the first step' do
get :index

expect(response).to redirect_to idv_in_person_step_url(step: :state_id)
expect(response).to redirect_to idv_in_person_proofing_state_id_path
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions spec/features/idv/analytics_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -509,10 +509,10 @@
flow_path: 'standard', opted_in_to_in_person_proofing: false
},
'IdV: in person proofing state_id visited' => {
step: 'state_id', flow_path: 'standard', step_count: 1, analytics_id: 'In Person Proofing'
step: 'state_id', flow_path: 'standard', analytics_id: 'In Person Proofing'
},
'IdV: in person proofing state_id submitted' => {
success: true, flow_path: 'standard', step: 'state_id', step_count: 1, analytics_id: 'In Person Proofing', errors: {}, same_address_as_id: false, birth_year: '1938', document_zip_code: '12345'
success: true, flow_path: 'standard', step: 'state_id', analytics_id: 'In Person Proofing', errors: {}, same_address_as_id: false, birth_year: '1938', document_zip_code: '12345'
},
'IdV: in person proofing address visited' => {
step: 'address', flow_path: 'standard', analytics_id: 'In Person Proofing', same_address_as_id: false
Expand Down
15 changes: 9 additions & 6 deletions spec/features/idv/in_person_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

before do
allow(IdentityConfig.store).to receive(:in_person_proofing_enabled).and_return(true)
allow(IdentityConfig.store).to receive(:in_person_state_id_controller_enabled).and_return(true)
end

it 'works for a happy path', allow_browser_log: true do
Expand Down Expand Up @@ -38,7 +39,7 @@
),
),
)
complete_state_id_step(user)
complete_state_id_controller(user)

# ssn page
expect_in_person_step_indicator_current_step(t('step_indicator.flows.idv.verify_info'))
Expand Down Expand Up @@ -290,7 +291,7 @@
end

it 'shows the address page' do
complete_state_id_step(user, same_address_as_id: false)
complete_state_id_controller(user, same_address_as_id: false)
expect_in_person_step_indicator_current_step(t('step_indicator.flows.idv.verify_info'))
expect(page).to have_content(t('in_person_proofing.headings.address'))

Expand All @@ -303,7 +304,7 @@
end

it 'can update the address page form' do
complete_state_id_step(user, same_address_as_id: false)
complete_state_id_controller(user, same_address_as_id: false)
complete_address_step(user, same_address_as_id: false)
complete_ssn_step(user)
# click update address link on the verify page
Expand All @@ -328,7 +329,7 @@
end

it 'allows user to update their residential address as different from their state id' do
complete_state_id_step(user, same_address_as_id: true)
complete_state_id_controller(user, same_address_as_id: true)
# skip address step b/c residential address is same as state id address
complete_ssn_step(user)

Expand Down Expand Up @@ -367,6 +368,8 @@

before do
allow(IdentityConfig.store).to receive(:in_person_outage_message_enabled).and_return(true)
allow(IdentityConfig.store).to receive(:in_person_state_id_controller_enabled).
and_return(true)
end

it 'allows the user to generate a barcode despite outage', allow_browser_log: true do
Expand Down Expand Up @@ -410,7 +413,7 @@
complete_location_step

# state ID page
complete_state_id_step(user, same_address_as_id: false)
complete_state_id_controller(user, same_address_as_id: false)

# address page
complete_address_step(user, same_address_as_id: false)
Expand Down Expand Up @@ -506,7 +509,7 @@
complete_prepare_step(user)
complete_location_step
# Causes the schedule USPS enrollment request to throw a bad request error
complete_state_id_step(user, first_name: 'usps client error')
complete_state_id_controller(user, first_name: 'usps client error')
complete_ssn_step(user)
complete_verify_step(user)
fill_out_phone_form_ok(MfaContext.new(user).phone_configurations.first.phone)
Expand Down
4 changes: 2 additions & 2 deletions spec/features/idv/in_person_threatmetrix_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def deactivate_profile_update_enrollment(status:)
complete_location_step(user)

# state ID page
complete_state_id_step(user)
complete_state_id_controller(user)

# ssn page
complete_ssn_step(user, 'Reject')
Expand Down Expand Up @@ -170,7 +170,7 @@ def deactivate_profile_update_enrollment(status:)
begin_in_person_proofing(user)
complete_prepare_step(user)
complete_location_step
complete_state_id_step(user)
complete_state_id_controller(user)

# ssn page
complete_ssn_step(user, tmx_status)
Expand Down
1 change: 1 addition & 0 deletions spec/features/idv/steps/in_person/verify_info_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

before do
allow(IdentityConfig.store).to receive(:in_person_proofing_enabled).and_return(true)
allow(IdentityConfig.store).to receive(:in_person_state_id_controller_enabled).and_return(false)
allow_any_instance_of(ApplicationController).to receive(:analytics).and_return(fake_analytics)
allow(user).to receive(:enrollment).
and_return(enrollment)
Expand Down
6 changes: 3 additions & 3 deletions spec/features/idv/steps/in_person_opt_in_ipp_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
complete_location_step

# state ID page
complete_state_id_step(user)
complete_state_id_controller(user)

# ssn page
select 'Reject', from: :mock_profiling_result
Expand Down Expand Up @@ -156,7 +156,7 @@
),
),
)
complete_state_id_step(user)
complete_state_id_controller(user)

# ssn page
expect_in_person_step_indicator_current_step(t('step_indicator.flows.idv.verify_info'))
Expand Down Expand Up @@ -341,7 +341,7 @@
),
),
)
complete_state_id_step(user)
complete_state_id_controller(user)

# ssn page
expect_in_person_step_indicator_current_step(t('step_indicator.flows.idv.verify_info'))
Expand Down
9 changes: 4 additions & 5 deletions spec/support/features/in_person_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def complete_location_step(_user = nil)

# pause for the location list to disappear
wait_for_content_to_disappear do
expect(page).to have_no_css('.location-collection-item')
expect(page).to have_no_css('.location-collection-item', wait: 1)
end
end

Expand Down Expand Up @@ -163,7 +163,6 @@ def complete_steps_before_state_id_step
begin_in_person_proofing
complete_prepare_step
complete_location_step

expect(page).to have_current_path(idv_in_person_step_path(step: :state_id), wait: 10)
end

Expand All @@ -180,7 +179,7 @@ def complete_all_in_person_proofing_steps(user = user_with_2fa, tmx_status = nil
same_address_as_id: true)
complete_prepare_step(user)
complete_location_step(user)
complete_state_id_step(user, same_address_as_id: same_address_as_id)
complete_state_id_controller(user, same_address_as_id: same_address_as_id)
complete_address_step(user, same_address_as_id: same_address_as_id) unless same_address_as_id
complete_ssn_step(user, tmx_status)
complete_verify_step(user)
Expand Down Expand Up @@ -256,9 +255,9 @@ def perform_mobile_hybrid_steps

def perform_desktop_hybrid_steps(user = user_with_2fa, same_address_as_id: true)
perform_in_browser(:desktop) do
expect(page).to have_current_path(idv_in_person_step_path(step: :state_id), wait: 10)
expect(page).to have_current_path(idv_in_person_proofing_state_id_path, wait: 10)

complete_state_id_step(user, same_address_as_id: same_address_as_id)
complete_state_id_controller(user, same_address_as_id: same_address_as_id)
complete_address_step(user, same_address_as_id: same_address_as_id) unless same_address_as_id
complete_ssn_step(user)
complete_verify_step(user)
Expand Down

0 comments on commit 0ee4561

Please sign in to comment.