eAPD icon indicating copy to clipboard operation
eAPD copied to clipboard

Nz/3354 cost allocation validation

Open Sun-Mountain opened this issue 2 years ago • 3 comments

Resolves #3354 and #3547

Description

Validation for the CostAllocate and OtherFunding forms. Originally this was split into two tickets, however it wasn't divided by component but rather by function. Because #3547 was about the OtherFunding component, I decided to combine the two into one PR.

Significant changes or possible side effects

Due to the nature of the dependent fields in the OtherFunding component, there is currently no react-hook controller around otherSources field, which may cause problems in the future with the admin check.

Steps to manually verify this change

  1. Go to an apd > activities > cost allocation
  2. Methodology should be required
  3. Other source should only be required if the corresponding other funds is greater than $0

This pull request is ready to review when

  • [x] Automated tests are updated (and all tests are passing)
  • [ ] Pull request has been labeled, if applicable with feature, content, bug, tests, refactor
  • [ ] Associated OpenAPI documentation has been updated
  • [ ] The experience passes a basic manual accessibility audit (keyboard nav, screenreader, text scaling) OR an exemption is documented

This pull request can be merged when

  • [ ] Code has been reviewed by someone other than the original author
  • [ ] QA has verified the accessibility and functionality related to the change
  • [ ] Design has approved the experience
  • [ ] Product has approved the experience

Sun-Mountain avatar Jul 12 '22 12:07 Sun-Mountain

Codecov Report

Merging #4186 (de4c466) into main (a98ac7b) will increase coverage by 1.03%. The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4186      +/-   ##
==========================================
+ Coverage   86.37%   87.41%   +1.03%     
==========================================
  Files         260       55     -205     
  Lines        5902     1112    -4790     
  Branches     1228        0    -1228     
==========================================
- Hits         5098      972    -4126     
+ Misses        745      140     -605     
+ Partials       59        0      -59     
Impacted Files Coverage Δ
...ies/cost-allocation/CostAllocation/CostAllocate.js
...ies/cost-allocation/CostAllocation/OtherFunding.js
web/src/pages/apd/activities/overview/Overview.js
web/src/pages/login/LoginGroupError.js
...eb/src/redux/actions/editApd/previousActivities.js
web/src/redux/actions/editApd/stateProfile.js
...activities/cost-allocation/CostAllocation/index.js
...src/pages/admin/fed-admin/MatchStateAdminDialog.js
...ities/state-costs/StatePerson/StatePersonReview.js
.../pages/apd/key-state-personnel/ApdKeyPersonForm.js
... and 195 more

Impacted file tree graph

Impacted Files Coverage Δ
...ies/cost-allocation/CostAllocation/CostAllocate.js
...ies/cost-allocation/CostAllocation/OtherFunding.js
web/src/pages/apd/activities/overview/Overview.js
web/src/pages/login/LoginGroupError.js
...eb/src/redux/actions/editApd/previousActivities.js
web/src/redux/actions/editApd/stateProfile.js
...activities/cost-allocation/CostAllocation/index.js
...src/pages/admin/fed-admin/MatchStateAdminDialog.js
...ities/state-costs/StatePerson/StatePersonReview.js
.../pages/apd/key-state-personnel/ApdKeyPersonForm.js
... and 195 more

Continue to review full report at Codecov.

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

codecov-commenter avatar Jul 12 '22 12:07 codecov-commenter

This deploy was cleaned up.

cms-eapd-bot avatar Jul 18 '22 16:07 cms-eapd-bot

Nice work! (Reviewing for #3354, Dio is going to handle #3547)

Given When Then Result
Description of cost allocation methodology field Changed to be blank/filled out If blank: error message appears. If filled out: error message doesn't appear PASS ✅
Other funding amount field testing out of bounds numbers Anything less than 0 is invalid, letters and other symbols are also invalid PASS ✅
Other funding amount field there is a validation error The validation error message is incorrect FAIL ❌

image Error message should be: Provide an other funding amount greater than or equal to $0.

mirano-darren avatar Jul 19 '22 17:07 mirano-darren