Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
5de046d
in progress changes maybe revert
Mar 1, 2024
10f1b2b
update helper to accept tmx status for ssn step
Mar 1, 2024
3c89dec
new tmx only spec
Mar 1, 2024
ddda20f
Merge branch 'main' of github.com:18F/identity-idp into jryan/lg-1206…
Mar 4, 2024
4e5e877
Add new method and allow arguments
Mar 5, 2024
e1dd289
Utilize new arguments for ssn step
Mar 5, 2024
49f73bd
begin specs
Mar 5, 2024
f6ffed1
initial specs complete
Mar 6, 2024
df2787a
added in test for cancel ipp option
Mar 6, 2024
4bb92a1
New spec for failed ipp enrollment
Mar 8, 2024
1a30cad
lintage
Mar 8, 2024
478a473
adding in action_account emulation
Mar 8, 2024
c610cdf
move tmx related specs to new file
Mar 8, 2024
a5d08fe
move tmx specs to new file
Mar 8, 2024
576f04e
lintereedoo
Mar 8, 2024
31f8639
add pass ipp fail tmx case
svalexander Mar 13, 2024
e1b2b7d
use one before statement
svalexander Mar 13, 2024
33f23b2
fix lint issue and update descriptions
svalexander Mar 14, 2024
3f93276
Merge branch 'main' into jryan/lg-12067-ipp-tmx-integration-tests
svalexander Mar 14, 2024
f70aef3
changelog: Internal, TMX, tests
svalexander Mar 15, 2024
50fb04f
comment out failing test to be completed in a future ticket
svalexander Mar 15, 2024
5cdd5fb
comment out another failing test
svalexander Mar 15, 2024
26143d0
Fixes trivial rubocop nit
n1zyy Mar 15, 2024
6c96897
Merge branch 'main' into jryan/lg-12067-ipp-tmx-integration-tests
n1zyy Mar 15, 2024
27e6455
ensure email count is updated after tmx review
svalexander Mar 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
132 changes: 1 addition & 131 deletions spec/features/idv/in_person_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,135 +10,6 @@
allow(IdentityConfig.store).to receive(:in_person_proofing_enabled).and_return(true)
end

context 'ThreatMetrix review pending' do
Copy link
Copy Markdown
Contributor Author

@JackRyan1989 JackRyan1989 Mar 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved the TMX related specs to in_person_threatmetrix_spec.rb

let(:user) { user_with_2fa }

before do
allow(IdentityConfig.store).to receive(:proofing_device_profiling).and_return(:enabled)
allow(IdentityConfig.store).to receive(:lexisnexis_threatmetrix_org_id).and_return('test_org')
end

it 'allows the user to continue down the happy path', allow_browser_log: true do
sign_in_and_2fa_user(user)
begin_in_person_proofing(user)
# prepare page
complete_prepare_step(user)

# location page
complete_location_step

# state ID page
complete_state_id_step(user)

# ssn page
select 'Reject', from: :mock_profiling_result
complete_ssn_step(user)

# verify page
expect_in_person_step_indicator_current_step(t('step_indicator.flows.idv.verify_info'))
expect(page).to have_content(t('headings.verify'))
expect(page).to have_current_path(idv_in_person_verify_info_path)
expect(page).to have_text(InPersonHelper::GOOD_FIRST_NAME)
expect(page).to have_text(InPersonHelper::GOOD_LAST_NAME)
expect(page).to have_text(InPersonHelper::GOOD_DOB_FORMATTED_EVENT)
expect(page).to have_text(InPersonHelper::GOOD_STATE_ID_NUMBER)
expect(page).to have_text(InPersonHelper::GOOD_IDENTITY_DOC_ADDRESS1).twice
expect(page).to have_text(InPersonHelper::GOOD_IDENTITY_DOC_ADDRESS2).twice
expect(page).to have_text(InPersonHelper::GOOD_IDENTITY_DOC_CITY).twice
expect(page).to have_text(
Idp::Constants::MOCK_IDV_APPLICANT[:state_id_jurisdiction],
count: 3,
)
expect(page).to have_text(InPersonHelper::GOOD_IDENTITY_DOC_ZIPCODE).twice
expect(page).to have_text(DocAuthHelper::GOOD_SSN_MASKED)
complete_verify_step(user)

# phone page
expect_in_person_step_indicator_current_step(
t('step_indicator.flows.idv.verify_phone_or_address'),
)
expect(page).to have_content(t('titles.idv.phone'))
fill_out_phone_form_ok(MfaContext.new(user).phone_configurations.first.phone)
click_idv_send_security_code
expect_in_person_step_indicator_current_step(
t('step_indicator.flows.idv.verify_phone_or_address'),
)

expect_in_person_step_indicator_current_step(
t('step_indicator.flows.idv.verify_phone_or_address'),
)
fill_in_code_with_last_phone_otp
click_submit_default

# password confirm page
expect_in_person_step_indicator_current_step(t('step_indicator.flows.idv.secure_account'))
expect(page).to have_content(t('idv.titles.session.enter_password', app_name: APP_NAME))
complete_enter_password_step(user)

# personal key page
expect_in_person_step_indicator_current_step(t('step_indicator.flows.idv.secure_account'))
expect(page).to have_content(t('titles.idv.personal_key'))
deadline = nil
freeze_time do
acknowledge_and_confirm_personal_key
deadline = (Time.zone.now +
IdentityConfig.store.in_person_enrollment_validity_in_days.days).
in_time_zone(Idv::InPerson::ReadyToVerifyPresenter::USPS_SERVER_TIMEZONE).
strftime(t('time.formats.event_date'))
end

# ready to verify page
expect_in_person_step_indicator_current_step(
t('step_indicator.flows.idv.go_to_the_post_office'),
)
expect_page_to_have_no_accessibility_violations(page)
enrollment_code = JSON.parse(
UspsInPersonProofing::Mock::Fixtures.request_enroll_response,
)['enrollmentCode']
expect(page).to have_content(t('in_person_proofing.headings.barcode').tr(' ', ' '))
expect(page).to have_content(Idv::InPerson::EnrollmentCodeFormatter.format(enrollment_code))
expect(page).to have_content(
t('in_person_proofing.body.barcode.deadline', deadline: deadline),
)
expect(page).to have_content('MILWAUKEE')
expect(page).to have_content('Sunday: Closed')

# signing in again before completing in-person proofing at a post office
Capybara.reset_session!
sign_in_live_with_2fa(user)
visit_idp_from_sp_with_ial2(:oidc)
expect(page).to have_current_path(idv_in_person_ready_to_verify_path)
end

it 'handles profiles in fraud review after 30 days', allow_browser_log: true do
sign_in_and_2fa_user(user)
begin_in_person_proofing(user)
complete_prepare_step(user)
complete_location_step
complete_state_id_step(user)

# ssn page
select 'Review', from: :mock_profiling_result
complete_ssn_step(user)
complete_verify_step(user)
complete_phone_step(user)
complete_enter_password_step(user)
acknowledge_and_confirm_personal_key

profile = InPersonEnrollment.last.profile
profile.deactivate_for_fraud_review
expect(profile.fraud_review_pending_at).to be_truthy
expect(profile.fraud_rejection_at).to eq(nil)
profile.update(fraud_review_pending_at: 31.days.ago)
FraudRejectionDailyJob.new.perform(Time.zone.now)

# profile is rejected
profile.reload
expect(profile.fraud_review_pending_at).to be(nil)
expect(profile.fraud_rejection_at).to be_truthy
end
end

it 'works for a happy path', allow_browser_log: true do
user = user_with_2fa

Expand Down Expand Up @@ -586,8 +457,7 @@
complete_address_step(user, same_address_as_id: false)

# ssn page
select 'Reject', from: :mock_profiling_result
complete_ssn_step(user)
complete_ssn_step(user, 'Reject')

# verify page
expect_in_person_step_indicator_current_step(t('step_indicator.flows.idv.verify_info'))
Expand Down
Loading