-
Notifications
You must be signed in to change notification settings - Fork 166
LG-12275 | Fixes opt-in IPP page displaying incorrectly #10016
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
11b9c13
54feb89
7449812
5bc1106
15b71e7
1268648
a53b94e
7eaee57
a3342af
2a98868
84308b0
113d8de
e75f7eb
70ed13a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,83 +4,179 @@ | |
| include IdvHelper | ||
| include DocAuthHelper | ||
|
|
||
| let(:user) { user_with_2fa } | ||
| let(:ipp_service_provider) { create(:service_provider, :active, :in_person_proofing_enabled) } | ||
|
|
||
| context 'when ipp is enabled and opt-in ipp is disabled' do | ||
| before do | ||
| allow(IdentityConfig.store).to receive(:in_person_proofing_enabled) { true } | ||
| allow(IdentityConfig.store).to receive(:in_person_proofing_opt_in_enabled) { false } | ||
| context 'and when sp has opted into ipp' do | ||
| before do | ||
| allow(IdentityConfig.store).to receive(:in_person_proofing_enabled) { true } | ||
| allow(IdentityConfig.store).to receive(:in_person_proofing_opt_in_enabled) { false } | ||
| allow_any_instance_of(ServiceProvider).to receive(:in_person_proofing_enabled). | ||
| and_return(true) | ||
| sign_in_and_2fa_user(user, issuer: ipp_service_provider.issuer) | ||
|
|
||
| sign_in_and_2fa_user | ||
| complete_doc_auth_steps_before_agreement_step | ||
| complete_agreement_step | ||
| complete_doc_auth_steps_before_agreement_step | ||
| complete_agreement_step | ||
| end | ||
|
|
||
| it 'skips when disabled and redirects to hybrid handoff' do | ||
| expect(page).to have_current_path(idv_hybrid_handoff_url) | ||
| end | ||
| end | ||
|
|
||
| it 'skips when disabled and redirects to hybrid handoff' do | ||
| expect(page).to have_current_path(idv_hybrid_handoff_url) | ||
| context 'and when sp has not opted into ipp' do | ||
| before do | ||
| allow(IdentityConfig.store).to receive(:in_person_proofing_enabled) { true } | ||
| allow(IdentityConfig.store).to receive(:in_person_proofing_opt_in_enabled) { false } | ||
| allow_any_instance_of(ServiceProvider).to receive(:in_person_proofing_enabled). | ||
| and_return(false) | ||
| sign_in_and_2fa_user(user, issuer: ipp_service_provider.issuer) | ||
|
|
||
| complete_doc_auth_steps_before_agreement_step | ||
| complete_agreement_step | ||
| end | ||
|
|
||
| it 'skips when disabled and redirects to hybrid handoff' do | ||
| expect(page).to have_current_path(idv_hybrid_handoff_url) | ||
| end | ||
| end | ||
| end | ||
|
|
||
| context 'when ipp is disabled and opt-in ipp is enabled' do | ||
| before do | ||
| allow(IdentityConfig.store).to receive(:in_person_proofing_enabled) { false } | ||
| allow(IdentityConfig.store).to receive(:in_person_proofing_opt_in_enabled) { true } | ||
| context 'and when sp has opted into ipp' do | ||
| before do | ||
| allow(IdentityConfig.store).to receive(:in_person_proofing_enabled) { false } | ||
| allow(IdentityConfig.store).to receive(:in_person_proofing_opt_in_enabled) { true } | ||
| allow_any_instance_of(ServiceProvider).to receive(:in_person_proofing_enabled). | ||
| and_return(true) | ||
| sign_in_and_2fa_user(user, issuer: ipp_service_provider.issuer) | ||
|
|
||
| sign_in_and_2fa_user | ||
| complete_doc_auth_steps_before_agreement_step | ||
| complete_agreement_step | ||
| complete_doc_auth_steps_before_agreement_step | ||
| complete_agreement_step | ||
| end | ||
|
|
||
| it 'skips when disabled and redirects to hybrid handoff' do | ||
| expect(page).to have_current_path(idv_hybrid_handoff_url) | ||
| end | ||
| end | ||
|
|
||
| it 'skips when disabled and redirects to hybird handoff' do | ||
| expect(page).to have_current_path(idv_hybrid_handoff_url) | ||
| context 'and when sp has not opted into ipp' do | ||
| before do | ||
| allow(IdentityConfig.store).to receive(:in_person_proofing_enabled) { false } | ||
| allow(IdentityConfig.store).to receive(:in_person_proofing_opt_in_enabled) { true } | ||
| allow_any_instance_of(ServiceProvider).to receive(:in_person_proofing_enabled). | ||
| and_return(false) | ||
| sign_in_and_2fa_user(user, issuer: ipp_service_provider.issuer) | ||
|
|
||
| complete_doc_auth_steps_before_agreement_step | ||
| complete_agreement_step | ||
| end | ||
|
|
||
| it 'skips when disabled and redirects to hybrid handoff' do | ||
| expect(page).to have_current_path(idv_hybrid_handoff_url) | ||
| end | ||
| end | ||
| end | ||
|
|
||
| context 'when both ipp and opt-in ipp are disabled' do | ||
| before do | ||
| allow(IdentityConfig.store).to receive(:in_person_proofing_enabled) { false } | ||
| allow(IdentityConfig.store).to receive(:in_person_proofing_opt_in_enabled) { false } | ||
| context 'and when sp has opted into ipp' do | ||
| before do | ||
| allow(IdentityConfig.store).to receive(:in_person_proofing_enabled) { false } | ||
| allow(IdentityConfig.store).to receive(:in_person_proofing_opt_in_enabled) { false } | ||
| allow_any_instance_of(ServiceProvider).to receive(:in_person_proofing_enabled). | ||
| and_return(true) | ||
| sign_in_and_2fa_user(user, issuer: ipp_service_provider.issuer) | ||
|
|
||
| sign_in_and_2fa_user | ||
| complete_doc_auth_steps_before_agreement_step | ||
| complete_agreement_step | ||
| complete_doc_auth_steps_before_agreement_step | ||
| complete_agreement_step | ||
| end | ||
|
|
||
| it 'skips when disabled and redirects to hybrid handoff' do | ||
| expect(page).to have_current_path(idv_hybrid_handoff_url) | ||
| end | ||
| end | ||
|
|
||
| it 'skips when disabled and redirects to hybird handoff' do | ||
| expect(page).to have_current_path(idv_hybrid_handoff_url) | ||
| context 'and when sp has not opted into ipp' do | ||
| before do | ||
| allow(IdentityConfig.store).to receive(:in_person_proofing_enabled) { false } | ||
| allow(IdentityConfig.store).to receive(:in_person_proofing_opt_in_enabled) { false } | ||
| allow_any_instance_of(ServiceProvider).to receive(:in_person_proofing_enabled). | ||
| and_return(false) | ||
| sign_in_and_2fa_user(user, issuer: ipp_service_provider.issuer) | ||
|
|
||
| complete_doc_auth_steps_before_agreement_step | ||
| complete_agreement_step | ||
| end | ||
|
|
||
| it 'skips when disabled and redirects to hybrid handoff' do | ||
| expect(page).to have_current_path(idv_hybrid_handoff_url) | ||
| end | ||
| end | ||
| end | ||
|
|
||
| context 'when both ipp and opt-in ipp are enabled' do | ||
| before do | ||
| allow(IdentityConfig.store).to receive(:in_person_proofing_enabled) { true } | ||
| allow(IdentityConfig.store).to receive(:in_person_proofing_opt_in_enabled) { true } | ||
| context 'and when sp has opted into ipp' do | ||
| before do | ||
| allow(IdentityConfig.store).to receive(:in_person_proofing_enabled) { true } | ||
| allow(IdentityConfig.store).to receive(:in_person_proofing_opt_in_enabled) { true } | ||
| allow_any_instance_of(ServiceProvider).to receive(:in_person_proofing_enabled). | ||
| and_return(true) | ||
|
|
||
| sign_in_and_2fa_user | ||
| complete_doc_auth_steps_before_agreement_step | ||
| complete_agreement_step | ||
| end | ||
| sign_in_and_2fa_user(user, issuer: ipp_service_provider.issuer) | ||
| complete_doc_auth_steps_before_agreement_step | ||
| complete_agreement_step | ||
| end | ||
|
|
||
| it 'displays expected content and requires a choice' do | ||
| expect(page).to have_current_path(idv_how_to_verify_path) | ||
|
|
||
| # Try to continue without an option | ||
| click_continue | ||
|
|
||
| expect(page).to have_current_path(idv_how_to_verify_path) | ||
| expect(page).to have_content(t('errors.doc_auth.how_to_verify_form')) | ||
|
|
||
| it 'displays expected content and requires a choice' do | ||
| expect(page).to have_current_path(idv_how_to_verify_path) | ||
| complete_how_to_verify_step(remote: true) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we should add another step where remote is
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch, and thanks for suggesting a much easier option than I would have thought of. 👼
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. thanks for adding this additional test! |
||
| expect(page).to have_current_path(idv_hybrid_handoff_url) | ||
|
|
||
| # go back and also test remote: false case | ||
| page.go_back | ||
| complete_how_to_verify_step(remote: false) | ||
| expect(page).to have_current_path(idv_document_capture_path) | ||
| end | ||
| end | ||
|
|
||
| # Try to continue without an option | ||
| click_continue | ||
| context 'and when sp has not opted into ipp' do | ||
| before do | ||
| allow(IdentityConfig.store).to receive(:in_person_proofing_enabled) { true } | ||
| allow(IdentityConfig.store).to receive(:in_person_proofing_opt_in_enabled) { true } | ||
| allow_any_instance_of(ServiceProvider).to receive(:in_person_proofing_enabled). | ||
| and_return(false) | ||
|
|
||
| expect(page).to have_current_path(idv_how_to_verify_path) | ||
| expect(page).to have_content(t('errors.doc_auth.how_to_verify_form')) | ||
| sign_in_and_2fa_user(user, issuer: ipp_service_provider.issuer) | ||
| complete_doc_auth_steps_before_agreement_step | ||
| complete_agreement_step | ||
| end | ||
|
|
||
| complete_how_to_verify_step(remote: true) | ||
| expect(page).to have_current_path(idv_hybrid_handoff_url) | ||
| it 'skips when disabled and redirects to hybrid handoff' do | ||
| expect(page).to have_current_path(idv_hybrid_handoff_url) | ||
| end | ||
| end | ||
| end | ||
|
|
||
| describe 'navigating to How To Verify from Agreement page in 50/50 state' do | ||
| describe 'navigating to How To Verify from Agreement page in 50/50 state | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do we need to mock opt in enabled for the service_provider for this spec?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I didn't realize this when we were discussing this on a call, but we have this covered further below. We test it both ways: 171-172 tests the opt-in provider case, and then further down on 180 we test with the opt-in feature flag disabled. |
||
| when the sp has opted into ipp' do | ||
| let(:user) { user_with_2fa } | ||
| before do | ||
| allow(IdentityConfig.store).to receive(:in_person_proofing_enabled) { true } | ||
| allow(IdentityConfig.store).to receive(:in_person_proofing_opt_in_enabled) { | ||
| initial_opt_in_enabled | ||
| } | ||
| allow_any_instance_of(ServiceProvider).to receive(:in_person_proofing_enabled). | ||
| and_return(true) | ||
|
|
||
| sign_in_and_2fa_user | ||
| sign_in_and_2fa_user(user, issuer: ipp_service_provider.issuer) | ||
| complete_doc_auth_steps_before_agreement_step | ||
| complete_agreement_step | ||
| end | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.