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

🚑 Fix Processed Trip Survey Responses Not Matching #1125

Conversation

JGreenlee
Copy link
Collaborator

Processed responses for user input surveys were not being matched because they were being looked up under "manual/trip_user_input", while it should have just been "trip_user_input". This is because we were only invoking a function to trim off "manual/" for MULTILABEL user input matching, and it was neglected for ENKETO.

Revise the functions in confirmHelper (keeping 2 versions, removeManualPrefix which just trims the key, and inputType2retKey which looks up the key and then trims), and use removeManualPrefix in inputMatcher appropriately

Some day we can unify the data model (e-mission/e-mission-docs#1045) and not keep 2 versions of so many things

Processed responses for user input surveys were not being matched because they were being looked up under "manual/trip_user_input", while it should have just been "trip_user_input".
This is because we were only invoking a function to trim off "manual/" for MULTILABEL user input matching, and it was neglected for ENKETO.

Revise the functions in confirmHelper (keeping 2 versions, `removeManualPrefix` which just trims the key, and `inputType2retKey` which looks up the key and then trims), and use `removeManualPrefix` in inputMatcher appropriately

Some day we can unify the data model (e-mission/e-mission-docs#1045) and not keep 2 versions of so many things
Copy link

codecov bot commented Feb 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (48633c3) 74.98% compared to head (e5ef8da) 77.55%.
Report is 1 commits behind head on service_rewrite_2023.

Additional details and impacted files
@@                   Coverage Diff                    @@
##           service_rewrite_2023    #1125      +/-   ##
========================================================
+ Coverage                 74.98%   77.55%   +2.57%     
========================================================
  Files                        28       28              
  Lines                      1699     1702       +3     
  Branches                    367      367              
========================================================
+ Hits                       1274     1320      +46     
+ Misses                      425      382      -43     
Flag Coverage Δ
unit 77.55% <100.00%> (+2.57%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
www/js/survey/inputMatcher.ts 81.37% <100.00%> (+27.90%) ⬆️
www/js/survey/multilabel/confirmHelper.ts 97.11% <100.00%> (+1.03%) ⬆️

... and 1 file with indirect coverage changes

Adds basic unit tests for mapInputsToTimelineEntries under both MULTILABEL and ENKETO configurations.
It considers fake user inputs that are processed, and those that are unprocessed, and ensures that the returned map includes both.
@JGreenlee JGreenlee marked this pull request as draft February 2, 2024 10:33
@JGreenlee JGreenlee marked this pull request as ready for review February 2, 2024 10:33
@JGreenlee
Copy link
Collaborator Author

Added some basic tests for mapInputsToTimelineEntries.
Having coverage for that function should prevent another issue like this from popping up again.

@JGreenlee
Copy link
Collaborator Author

@shankari for visibility

@shankari shankari merged commit 9ddcf31 into e-mission:service_rewrite_2023 Feb 2, 2024
6 checks passed
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