eAPD
eAPD copied to clipboard
Nz/3354 cost allocation validation
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
- Go to an apd > activities > cost allocation
- Methodology should be required
- 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
Codecov Report
Merging #4186 (de4c466) into main (a98ac7b) will increase coverage by
1.03%
. The diff coverage isn/a
.
@@ 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
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.
This deploy was cleaned up.
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 ❌ |
Error message should be: Provide an other funding amount greater than or equal to $0.