-
Notifications
You must be signed in to change notification settings - Fork 0
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
FI-3222: DTR Client Tests: Use Random Number for Attestation Continuation Links #20
FI-3222: DTR Client Tests: Use Random Number for Attestation Continuation Links #20
Conversation
The changes Look good. While we're doing this, I would change the use of client_id in dtr_questionnaire_rendering_attestation_test.rb because it also means that the client_id input gets added to a group that it wouldn't otherwise be on (all others are involved in communication with inferno, so its already needed). This will ideally require a few other changes
|
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.
see my comment on one place to replace the use of client_id
54926aa
to
f868ae5
Compare
- Fixed typos in `lib/davinci_dtr_test_kit/client_groups/resp_assist_device/dtr_questionnaire_rendering_attestation_test.rb`
f868ae5
to
84bf302
Compare
…to use token instead of client_id -Addressed rubocop warnings -Changed lib/davinci_dtr_test_kit/dtr_smart_app_suite.rb to extract the session identifier from the new parameter name using the extract_token_from_query_params -Updated tests to use the correct token definition
7c53623
to
e0ccd78
Compare
-Ensured the attestation tests for resp work -Updated the resume_test_routes in mock_auth_server.rb to check for parameter value
) | ||
input :client_id | ||
|
||
config(options: { token: SecureRandom.uuid }) |
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.
@vanessuniq @degradification - can you explain the use of a config option here instead of including it in the run block as done in all the other tests? Should this pattern be used everywhere?
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.
This workaround allows for unit testing this test. When the token is included as a variable within the run
block, mocking the requests get("#{resume_pass_url}?token=#{token}")
or get("#{resume_fail_url}?token=#{token}")
in the spec file spec/davinci_dtr_test_kit/dtr_questionnaire_rendering_group_spec.rb
will always results in a "wait" status instead of a "pass" or "fail." This happens because the token defined in the unit test will always differ from the token generated in the test's run
block.
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.
interesting - we haven't typically unit tested attestations because they are so simple. On the fence as to whether I think using this more complicated pattern is worth enabling unit tests. But since we already had them, let's leave in place and call this good. Thanks!
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.
Actually, I found a simpler way, keeping the token in the run block. will reach out to Dalton to refactor and keep it simple before we merge it.
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.
one last question.
) | ||
input :client_id | ||
|
||
config(options: { token: SecureRandom.uuid }) |
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.
interesting - we haven't typically unit tested attestations because they are so simple. On the fence as to whether I think using this more complicated pattern is worth enabling unit tests. But since we already had them, let's leave in place and call this good. Thanks!
Description
This ticket updated the Full EHR and SMART App attestation tests to use random ids instead of client id tokens
Important Changes
Removed client id tokens and replaced with random id tokens for the following files
lib/davinci_dtr_test_kit/client_groups/dinner_static/dtr_full_ehr_launch_attestation_test.rb
lib/davinci_dtr_test_kit/client_groups/dinner_static/dtr_full_ehr_prepopulation_attestation_test.rb
lib/davinci_dtr_test_kit/client_groups/dinner_static/dtr_full_ehr_prepopulation_override_attestation_test.rb
lib/davinci_dtr_test_kit/client_groups/dinner_static/dtr_full_ehr_rendering_enabled_questions_attestation_test.rb
lib/davinci_dtr_test_kit/client_groups/dinner_static/dtr_full_ehr_store_attestation_test.rb
lib/davinci_dtr_test_kit/client_groups/dinner_static/dtr_smart_app_prepopulation_attestation_test.rb
lib/davinci_dtr_test_kit/client_groups/dinner_static/dtr_smart_app_prepopulation_override_attestation_test.rb
lib/davinci_dtr_test_kit/client_groups/dinner_static/dtr_smart_app_rendering_enabled_questions_attestation_test.rb
lib/davinci_dtr_test_kit/client_groups/resp_assist_device/dtr_questionnaire_rendering_attestation_test.rb
lib/davinci_dtr_test_kit/mock_auth_server.rb
lib/davinci_dtr_test_kit/dtr_smart_app_suite.rb
spec/davinci_dtr_test_kit/dtr_questionnaire_rendering_group_spec.rb
dtr_questionnaire_rendering_attestation_test.rb
was received and returnedTesting Recommendations
Make sure all unit tests pass (unit tests were not added for this pull request), and the application runs as expected. Run the FullEHR tests to test both expected successes and expected failures. Run the SMART App Test Suite tests to test both expected success and expected failures.
Checklists
Submitter:
Final Merger