Conversation
…7-ipp-tmx-integration-tests Merging main to hopefully handle weird js errors during tests.
| update(in_person_proofing_enabled: true) | ||
| end | ||
|
|
||
| def deactivate_profile_update_enrollment(status:) |
There was a problem hiding this comment.
So in thinking about this a bit more, this maybe isn't the best idea. I'm obscuring some important things that happen in the flow, and are basically stand-ins for the get_usps_proofing_job. Not sure what the best approach here is. I suppose this can be unwound so that the deactivation and updates are more explicit in the spec, or this thing can be moved to the in_person_helper if that is a more appropriate place for this sort of method.
There was a problem hiding this comment.
i do like the idea of moving this function out of the file...maybe to a threatmetrix_helper file? though the in_person_helper is also a good place
There was a problem hiding this comment.
I keep going back and forth on the best approach here. I have two somewhat contradictory opinions:
- Too many of our tests are really redundant, repeating with just a few changes like 20 lines of setup for each case, that could really be factored out. Beyond some ideas about cleanliness, I think this would make it easier to reason about what was happening.
- Some of our tests take shortcuts with setup that aren't consistent with what happens "in the real world," and occasionally this masks issues.
So I like this approach for helping with #1. For #2, I wonder if you could actually call GetUspsProofingResultsJob live here?
But, I also think this is an improvement as-is and am on board with
your improved, expanded test coverage and potentially coming back later to polish it a bit more.
There was a problem hiding this comment.
those are great points. as for using that job I believe we could do that here. I'll try to update it
There was a problem hiding this comment.
I'm encountering an error related to usermailer when I try to include GetUspsProofingResultsJob. I wonder if that's why we're updating the enrollment as we are here, to get around the mailer issue?
There was a problem hiding this comment.
@svalexander that's exactly why I went with directly updating the enrollment.
| end | ||
|
|
||
| def complete_ssn_step(_user = nil) | ||
| def complete_ssn_step(_user = nil, tmx_status = nil) |
There was a problem hiding this comment.
added this arg to help toggle the tmx_status. However, we don't always toggle the value, hence the default nil.
There was a problem hiding this comment.
this is a great addition
| complete_verify_step(user) | ||
| end | ||
|
|
||
| def complete_entire_ipp_flow(user = user_with_2fa, tmx_status = nil, same_address_as_id: true) |
There was a problem hiding this comment.
Decided to make a helper method for the entire flow from sign in to personal key acknowledgement. I don't think I'm duplicating work here?
There was a problem hiding this comment.
from what i can see that seems accurate. good addition to have
There was a problem hiding this comment.
I'm biased, but I like this approach. It DRYs up a lot.
| # update the enrollment: | ||
| enrollment.update( | ||
| status: status, | ||
| proofed_at: Time.zone.now, |
There was a problem hiding this comment.
The proofed_at and status_check_completed_at values are never checked. So I suppose we could remove them, but I wanted to more closely emulate how the enrollment gets updated.
| allow(IdentityConfig.store).to receive(:in_person_proofing_enabled).and_return(true) | ||
| end | ||
|
|
||
| context 'ThreatMetrix review pending' do |
There was a problem hiding this comment.
Moved the TMX related specs to in_person_threatmetrix_spec.rb
| # user can restart | ||
| click_on t('idv.cancel.actions.start_over') | ||
|
|
||
| expect(page).to have_current_path(idv_welcome_path) |
There was a problem hiding this comment.
this now fails after the merge of the recent bug fix. The before action confirm_fraud_pending in the please_call_controller is not redirecting as fraud_review_pending? is true. (though that method would redirect us to the account page and not the welcome page)
| end | ||
| end | ||
|
|
||
| # To be completed in a future ticket |
There was a problem hiding this comment.
Ticket added to address these 2 commented out specs
n1zyy
left a comment
There was a problem hiding this comment.
Nice work here, both @JackRyan1989 for laying an excellent foundation that exposed some bugs, and @svalexander for picking it up and running with it (and also catching bugs 🥲).
Please remove WIP from the PR title before merging, but I'm really happy with where this ended up. All that remains is rubocop yelling that a commented-out line is now one character too long.
| update(in_person_proofing_enabled: true) | ||
| end | ||
|
|
||
| def deactivate_profile_update_enrollment(status:) |
There was a problem hiding this comment.
I keep going back and forth on the best approach here. I have two somewhat contradictory opinions:
- Too many of our tests are really redundant, repeating with just a few changes like 20 lines of setup for each case, that could really be factored out. Beyond some ideas about cleanliness, I think this would make it easier to reason about what was happening.
- Some of our tests take shortcuts with setup that aren't consistent with what happens "in the real world," and occasionally this masks issues.
So I like this approach for helping with #1. For #2, I wonder if you could actually call GetUspsProofingResultsJob live here?
But, I also think this is an improvement as-is and am on board with
your improved, expanded test coverage and potentially coming back later to polish it a bit more.
| expect_in_person_step_indicator_current_step( | ||
| t('step_indicator.flows.idv.go_to_the_post_office'), | ||
| ) | ||
| expect(page).to have_content(t('in_person_proofing.headings.barcode').tr(' ', ' ')) |
There was a problem hiding this comment.
Not for this PR, especially because this was just moved around (and I think I may have written the original line I'm now objecting to 😆), but I wonder if we can move the .tr(' ', ' ')) pattern into a helper method explaining what the heck it's doing later on. It's not at all intuitive that these are two different strings (replacing a non-breaking space with a regular space, or vice versa).
But again, not for now. I'll file a ticket.
🎫 Ticket
Link to the relevant ticket:
LG-12067
🛠 Summary of changes
Lots of specs written.
To do:
in_person_threatmetrix_specand the IPP fail and TMX fail spec starting on line 234. See if you can replicate these failures and then fix. There's a third test that's failing as well but I think that one is chromedriver based. Not sure though.📜 Testing Plan
Get the specs to pass