freeCodeCamp icon indicating copy to clipboard operation
freeCodeCamp copied to clipboard

Customer Complaint Form - undefined edge case

Open gikf opened this issue 9 months ago • 1 comments

Describe the Issue

There's edge case with #complaint-description and #solution-description, that's not addressed in instructions and test hints.

  • If #other-complaint is checked and #complaint-description contents have less than 20 characters, validateForm()["solution-description"] should be false.
  • If #other-complaint is checked and #complaint-description contents have at least 20 characters, validateForm()["solution-description"] should be true.
  • It is unclear though what value validateForm()["solution-description"] should have, when #other-complaint is not checked.
  • Similar issue is with the #other-solution radio button and #solution-description.

Per specification:

validateForm (...) the value of each key should be true if the corresponding form field is correctly filled and false otherwise.

isValid that takes the object returned by validateForm as argument and returns true if every form field is correctly filled and false otherwise.

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

gikf avatar Mar 06 '25 18:03 gikf

@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.

majestic-owl448 avatar Mar 07 '25 16:03 majestic-owl448