-
Notifications
You must be signed in to change notification settings - Fork 166
CL-8938 - fix idv_document_upload_submitted event #7918
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
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 |
|---|---|---|
|
|
@@ -73,7 +73,7 @@ | |
| any_args, | ||
| ) | ||
|
|
||
| expect(@irs_attempts_api_tracker).not_to receive(:track_event).with( | ||
| expect(@irs_attempts_api_tracker).to receive(:track_event).with( | ||
| :idv_document_upload_submitted, | ||
| any_args, | ||
| ) | ||
|
|
@@ -129,9 +129,21 @@ | |
| flow_path: 'standard', | ||
| ) | ||
|
|
||
| expect(@irs_attempts_api_tracker).not_to receive(:track_event).with( | ||
| expect(@irs_attempts_api_tracker).to receive(:track_event).with( | ||
| :idv_document_upload_submitted, | ||
| any_args, | ||
| { address: nil, | ||
| date_of_birth: nil, | ||
| document_back_image_filename: nil, | ||
| document_expiration: nil, | ||
| document_front_image_filename: nil, | ||
| document_image_encryption_key: nil, | ||
| document_issued: nil, | ||
| document_number: nil, | ||
| document_state: nil, | ||
| failure_reason: { front: ['The selection was not a valid file.'] }, | ||
| first_name: nil, | ||
| last_name: nil, | ||
| success: false }, | ||
| ) | ||
|
|
||
| expect(@analytics).not_to receive(:track_event).with( | ||
|
|
@@ -229,9 +241,27 @@ | |
| flow_path: 'standard', | ||
| ) | ||
|
|
||
| expect(@irs_attempts_api_tracker).not_to receive(:track_event).with( | ||
| expect(@irs_attempts_api_tracker).to receive(:track_event).with( | ||
| :idv_document_upload_rate_limited, | ||
| ) | ||
|
|
||
| # This is the last upload which triggers the rate limit, apparently. | ||
| # I do find this moderately confusing. | ||
|
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. Someone want to check my logic here? I wasn't expecting both events initially, but that seems to be what happens with analytics events. Want to make sure I'm enshrining a new bug in tests.
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. I think there's the attempt, and then that triggers the limit? I think that's fine |
||
| expect(@irs_attempts_api_tracker).to receive(:track_event).with( | ||
| :idv_document_upload_submitted, | ||
| any_args, | ||
| { address: nil, | ||
| date_of_birth: nil, | ||
| document_back_image_filename: nil, | ||
| document_expiration: nil, | ||
| document_front_image_filename: nil, | ||
| document_image_encryption_key: nil, | ||
| document_issued: nil, | ||
| document_number: nil, | ||
| document_state: nil, | ||
| failure_reason: { limit: ['We could not verify your ID'] }, | ||
| first_name: nil, | ||
| last_name: nil, | ||
| success: false }, | ||
| ) | ||
|
|
||
| expect(@analytics).not_to receive(:track_event).with( | ||
|
|
||
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.
Opinion question: I think the academically-correct thing to do here would be to re-use the
front: [I18n.t('doc_auth.errors.not_a_file')]that's set up above, maybe moving it to a littlelet(:error_msg)assignment.I have a slight preference for using the actual English string here, though, to better highlight the unusual (compared to other events) behavior where we are sending the actual translated string across. I think this makes it clearer.
Anyone feel strongly one way or the other?
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.
i think it's fine to hardcode the string like this, makes it easiest to change if something else changes