-
Notifications
You must be signed in to change notification settings - Fork 166
LG-14653 | Log state_id_type on doc auth result event #11328
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
e8e71b9
1cb41c0
6e6a0cc
30be39e
9384d43
2cd4729
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 | ||
|---|---|---|---|---|
|
|
@@ -349,6 +349,10 @@ | |||
| }, | ||||
| ), | ||||
| ) | ||||
|
|
||||
| event = @analytics.events["IdV: doc auth verify proofing results"].first | ||||
| state_id = event[:proofing_results][:context][:stages][:state_id] | ||||
| expect(state_id).to match(a_hash_including(state_id_type: 'drivers_license')) | ||||
|
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 couldn't find prior art for handling this situation... I basically wanted: expect(@analytics).to have_logged_event(
'IdV: doc auth verify proofing results',
hash_including(
{
proofing_results => context => stages => state_id => { state_id_type: 'drivers_license' }
},
),
)except that's not valid code. I started nesting hash_including but it got really unwieldy fast.
The test above feels inelegant, except compared to every other option I tried.
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 have one double-nested hash-including here:
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. but I think that you're right, doing a point-check is clearer here
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. It's almost like we need expect(@analytics).to have_logged_event(
event_name,
hash_deeply_including(
[:proofing_results, :context, :stages, :state_id],
{state_id_type: 'drivers_license'},
),
)
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. @lmgeorge Something like this came up in the I think I agree more with the comment in that thread that something being clunky to test is often a smell that the code (or here, data structure) is too convoluted. That's not an easy fix in this PR, though.
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. Agreed. This is one of those do you fix "all the things" or just try to make your current need work. Either way, adding a custom matcher or dramatically restructuring the analytics event is beyond the scope of this PR. |
||||
| end | ||||
| end | ||||
|
|
||||
|
|
||||
Uh oh!
There was an error while loading. Please reload this page.