-
Notifications
You must be signed in to change notification settings - Fork 166
LG-9141 Skip address page if same address as ID is true #8151
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
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
6a9f86a
round of changes complete
jack-ryan-nava-pbc 9d65f83
Merge branch 'main' of github.com:18F/identity-idp into jryan/lg-9141…
jack-ryan-nava-pbc 620f6e2
Adding and modifying tests
jack-ryan-nava-pbc 95fa93f
changelog: User-Facing Improvements, In-Person Proofing, Skip address…
jack-ryan-nava-pbc fef11f7
Linting
jack-ryan-nava-pbc b20a8cf
Merge branch 'main' of github.com:18F/identity-idp into jryan/lg-9141…
jack-ryan-nava-pbc 0cb5dbb
update tests and state id spec to change jurisdiction
jack-ryan-nava-pbc c401e76
Missed jurisdiction in test
jack-ryan-nava-pbc a203052
last jurisdiction
jack-ryan-nava-pbc b2d1409
undoing call to mark address incomplete
jack-ryan-nava-pbc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,6 +4,8 @@ | |
| let(:submitted_values) { {} } | ||
| let(:params) { ActionController::Parameters.new({ state_id: submitted_values }) } | ||
| let(:user) { build(:user) } | ||
| let(:capture_secondary_id_enabled) { false } | ||
| let(:enrollment) { InPersonEnrollment.new(capture_secondary_id_enabled:) } | ||
| let(:service_provider) { create(:service_provider) } | ||
| let(:controller) do | ||
| instance_double( | ||
|
|
@@ -27,18 +29,25 @@ | |
| let(:first_name) { 'Natalya' } | ||
| let(:last_name) { 'Rostova' } | ||
| let(:dob) { '1980-01-01' } | ||
| let(:state_id_jurisdiction) { 'Nevada' } | ||
| let(:state_id_state) { 'Nevada' } | ||
| let(:state_id_number) { 'ABC123234' } | ||
| let(:submitted_values) do | ||
| { | ||
| first_name: first_name, | ||
| last_name: last_name, | ||
| dob: dob, | ||
| state_id_jurisdiction: state_id_jurisdiction, | ||
| state_id_state: state_id_state, | ||
| state_id_number: state_id_number, | ||
| } | ||
| end | ||
|
|
||
| before do | ||
| allow(IdentityConfig.store).to receive(:in_person_capture_secondary_id_enabled). | ||
| and_return(false) | ||
| allow(user).to receive(:establishing_in_person_enrollment). | ||
| and_return(enrollment) | ||
| end | ||
|
|
||
| it 'sets values in flow session' do | ||
| Idv::StateIdForm::ATTRIBUTES.each do |attr| | ||
| expect(flow.flow_session[:pii_from_user]).to_not have_key attr | ||
|
|
@@ -50,7 +59,7 @@ | |
| expect(pii_from_user[:first_name]).to eq first_name | ||
| expect(pii_from_user[:last_name]).to eq last_name | ||
| expect(pii_from_user[:dob]).to eq dob | ||
| expect(pii_from_user[:state_id_jurisdiction]).to eq state_id_jurisdiction | ||
| expect(pii_from_user[:state_id_state]).to eq state_id_state | ||
| expect(pii_from_user[:state_id_number]).to eq state_id_number | ||
| end | ||
|
|
||
|
|
@@ -150,4 +159,70 @@ | |
| end | ||
| end | ||
| end | ||
|
|
||
| describe 'skip address step?' do | ||
| 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(:enrollment) { InPersonEnrollment.new(capture_secondary_id_enabled:) } | ||
| let(:dob) { '1980-01-01' } | ||
| let(:state_id_state) { 'Nevada' } | ||
| let(:state_id_city) { 'Twin Peaks' } | ||
| let(:state_id_address1) { '123 Sesame Street' } | ||
| let(:state_id_address2) { 'Apt. #C' } | ||
| let(:state_id_zipcode) { '90001' } | ||
| let(:same_address_as_id) { 'true' } | ||
| let(:submitted_values) do | ||
| { | ||
| dob: dob, | ||
| state_id_state: state_id_state, | ||
| state_id_city: state_id_city, | ||
| state_id_address1: state_id_address1, | ||
| state_id_address2: state_id_address2, | ||
| state_id_zipcode: state_id_zipcode, | ||
| same_address_as_id: same_address_as_id, | ||
| } | ||
| end | ||
|
|
||
| before(:each) do | ||
| allow(step).to receive(:current_user). | ||
| and_return(user) | ||
| allow(user).to receive(:establishing_in_person_enrollment). | ||
| and_return(enrollment) | ||
| end | ||
|
|
||
| context 'same address as id' do | ||
| it 'marks the address step as complete' do | ||
| step.call | ||
|
|
||
| address_step = flow.flow_session[Idv::Steps::InPerson::AddressStep.name] | ||
| expect(address_step).to eq true | ||
| end | ||
|
|
||
| it 'adds state id values to address values in pii' do | ||
| step.call | ||
|
|
||
| pii_from_user = flow.flow_session[:pii_from_user] | ||
| expect(pii_from_user[:address1]).to eq state_id_address1 | ||
| expect(pii_from_user[:address2]).to eq state_id_address2 | ||
| expect(pii_from_user[:city]).to eq state_id_city | ||
| expect(pii_from_user[:state]).to eq state_id_state | ||
| expect(pii_from_user[:zipcode]).to eq state_id_zipcode | ||
| end | ||
| end | ||
|
|
||
| context 'different address from id' do | ||
|
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. Clear testing, nice! 👏🏻 |
||
| let(:same_address_as_id) { 'false' } | ||
| it 'does not add state id values to address values in pii' do | ||
| step.call | ||
|
|
||
| pii_from_user = flow.flow_session[:pii_from_user] | ||
| expect(pii_from_user[:address1]).to_not eq state_id_address1 | ||
| expect(pii_from_user[:address2]).to_not eq state_id_address2 | ||
| expect(pii_from_user[:city]).to_not eq state_id_city | ||
| expect(pii_from_user[:state]).to_not eq state_id_state | ||
| expect(pii_from_user[:zipcode]).to_not eq state_id_zipcode | ||
| end | ||
| end | ||
| end | ||
| end | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉