Customer Complaint Form - undefined edge case
Describe the Issue
There's edge case with #complaint-description and #solution-description, that's not addressed in instructions and test hints.
- If
#other-complaintis checked and#complaint-descriptioncontents have less than20characters,validateForm()["solution-description"]should befalse. - If
#other-complaintis checked and#complaint-descriptioncontents have at least20characters,validateForm()["solution-description"]should betrue. - It is unclear though what value
validateForm()["solution-description"]should have, when#other-complaintis not checked. - Similar issue is with the
#other-solutionradio button and#solution-description.
Per specification:
validateForm(...) the value of each key should betrueif the corresponding form field is correctly filled andfalseotherwise.
isValidthat takes the object returned byvalidateFormas argument and returnstrueif every form field is correctly filled andfalseotherwise.
One of the tests is checking if isValid returns true when #other-complaint and #other-solution are not checked. This might be the only failing test, when somebody assumes "solution-description" or "complaint-description" should still validate to false if they don't have 20 characters, but their correspondent Other option is not checked. In that case test hint will not help much with narrowing down the issue.
https://github.com/freeCodeCamp/freeCodeCamp/blob/af05efca4a0f697fccce2bfebd8aff1846d4f0fa/curriculum/challenges/english/25-front-end-development/lab-customer-complaint-form/67279fe50237291f80eed8b8.md?plain=1#L311-L330
Affected Page
https://www.freecodecamp.org/learn/full-stack-developer/lab-customer-complaint-form/build-a-customer-complaint-form
@locthdzev it doesn't look like you understand the issue opened, please familiarize yourself with the curriculum and the contributing guidelines before trying to help.