Skip to content
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

Assessments tests and minor fixes #56

Merged
merged 5 commits into from
Mar 11, 2024
Merged

Conversation

YurenSUN
Copy link
Contributor

@YurenSUN YurenSUN commented Mar 10, 2024

Assessments tests and minor fixes

♻️ Current situation & Problem

Currently, we only implement the assessments tab for #44 but we did not write any tests to test it. Therefore, this PR aims to add the UI and uni tests for the assessments tab, including each of the tasks and the visualization of results.
Currently, we only test creating the task for trail making and reaction time task as described below, but we reach the desired test coverage and 539 out of 589 lines (~91.5%) in the assessment folder are covered. This PR also includes some small fixes described below.

⚙️ Release Notes

  • tests the assessment tasks. Currently, we run through the Stroop task during the UI task and only test creating tasks for (1) trail-making task as we are unable to click the buttons to make trails as they are not shown in the app but grouped into an Other element Tappable Buttons and (2) reaction time as currently there is no supports for the shake motion in testing. This should be acceptable as the process of the two tasks is also solely handled by the ResaerchKit, and we only wrote functions to create and parse the results.
  • Add the additional unit task to the function parsing the trail-making task to ensure that no error is returned
  • We are missing tests for parsing the reaction time result as the simulator does not support result files, which is required when parsing the reaction time result.

Other fixes

  • Fix some colors for the dark mode for HealthKit visualizations.
  • Fix the issue that the running task occurs on both the main screen and the sheet. Also change the toggle showingTestSheet to directly setting to true to avoid the sheet not re-rendering (always showing trail-making task) issue.
  • Do not show chart legend for score/error count if those data are not collected.
image

📚 Documentation

Related commends are added to the codes.

✅ Testing

The PR adds tests to our codes.

📝 Code of Conduct & Contributing Guidelines

By submitting creating this pull request, you agree to follow our Code of Conduct and Contributing Guidelines:

Copy link

codecov bot commented Mar 10, 2024

Codecov Report

Attention: Patch coverage is 87.69231% with 8 lines in your changes are missing coverage. Please review.

Project coverage is 54.75%. Comparing base (3be7d9a) to head (b0ac9d4).

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##             main      #56       +/-   ##
===========================================
+ Coverage   36.18%   54.75%   +18.57%     
===========================================
  Files          54       54               
  Lines        2977     2974        -3     
===========================================
+ Hits         1077     1628      +551     
+ Misses       1900     1346      -554     
Files Coverage Δ
PICS/Assessment/Assessments.swift 100.00% <100.00%> (+95.53%) ⬆️
PICS/Assessment/ReactionTime.swift 56.17% <100.00%> (+56.17%) ⬆️
PICS/Assessment/ResultsViz.swift 96.90% <100.00%> (+96.90%) ⬆️
PICS/Assessment/StroopTest.swift 98.37% <100.00%> (+98.37%) ⬆️
PICS/HealthVisulization/HKVisualizationItem.swift 96.38% <100.00%> (ø)
PICS/Assessment/TrailMakingTest.swift 82.82% <69.24%> (+82.82%) ⬆️

... and 6 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3be7d9a...b0ac9d4. Read the comment docs.

@YurenSUN YurenSUN marked this pull request as ready for review March 11, 2024 00:09
@YurenSUN YurenSUN requested a review from akanshyabhat March 11, 2024 00:27
Copy link
Contributor

@akanshyabhat akanshyabhat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! Thank you :)

@YurenSUN YurenSUN changed the title Assessments tasks and minor fixes Assessments tests and minor fixes Mar 11, 2024
@YurenSUN YurenSUN merged commit e58a3a8 into main Mar 11, 2024
7 checks passed
@YurenSUN YurenSUN deleted the yuren-assessment-tests-minor-fixes branch March 11, 2024 00:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants