GSA-TTS / FAC

GSA's Federal Audit Clearinghouse
Other
18 stars 5 forks source link

FAC - Bug: audit_period_other_months Doesn't Accept Single Digit Values #3969

Closed jperson1 closed 3 days ago

jperson1 commented 3 weeks ago

Describe the bug

An example from ZenDesk: https://fac-gov.zendesk.com/agent/tickets/3749

When submitting the general information form, the audit_period_other_months field expects two digits. So a user with an audit period of seven months is expected to enter 07, and not just 7. This results in an error on schema validation that is hard to interpret.

We should either:

  1. Update the regex for audit_period_other_months validation to accept a single character, non-zero response. See here.

OR

  1. Pass a more useful error back, which can be presented to the user. See https://github.com/GSA-TTS/FAC/issues/3970

OR

  1. Append a zero to the front of single digit values so that they pass schema validation. This can be done either at the form cleaning step, the view post step, or in the general information validation step.

Steps to reproduce the bug

  1. Navigate to the general information form
  2. Select Audit period -> Other
  3. Enter a single digit audit period, such as 7
  4. Verify that an error occurs, and the form comes back with: a. No/wrong inputted information b. Incorrectly formatted dates

Expected Behavior

  1. Navigate to the general information form
  2. Select Audit period -> Other
  3. Enter a single digit audit period, such as 7
  4. The form submits and the information is saved, whether it is a single or padded double digit value.

Screenshots

Does not validate, but should. image

System setup

No response

Additional context

No response

Code of Conduct