Page MenuHomePhabricator

Error /validation states: wish form
Closed, ResolvedPublic

Assigned To
Authored By
JWheeler-WMF
Apr 23 2024, 8:19 PM
Referenced Files
F56359020: 2024-07-11_10-26-55.png
Jul 11 2024, 6:07 PM
F56359018: 2024-07-11_10-23-08.png
Jul 11 2024, 6:07 PM
F56359003: 2024-07-11_10-18-59.png
Jul 11 2024, 6:07 PM
F56358993: 2024-07-11_10-19-42.png
Jul 11 2024, 6:07 PM
F56358980: 2024-07-11_10-24-27.png
Jul 11 2024, 6:07 PM
F56358978: 2024-07-11_10-23-42.png
Jul 11 2024, 6:07 PM
F56358935: 2024-07-11_10-22-05.png
Jul 11 2024, 6:07 PM
F56358968: 2024-07-11_10-47-25.png
Jul 11 2024, 6:07 PM

Description

Background
We want to inform users when their form is incomplete, so that they can publish a valid form response. This ticket is for clicking publish when there is no "draft" state.

User story / requirement
Given that I am filling out the form and miss a required field, when I click submit, then I should see validation errors on invalid form fields, and be able to edit my response.

Show an error state when a user hasn't selected a required field, or if a field doesn't hit a character limit

  • Title: min 5 characters, max 70
  • Description: 50+ characters
  • "wish type": Select 1
  • Project(s): Select 1+ or “other”. Other needs 3+ characters
  • Impacted users: 5+ characters

Derived Requirement

Ensure the wish form correctly handles error and validation states, providing users with appropriate feedback when submitting the form.

BDD

Feature: Wish Form Error and Validation States

Scenario: Display error and validation messages on wish form

Given a user filling out the wish form
When the user submits the form with invalid data
Then appropriate error and validation messages should be displayed
Test Steps

Test Case 1: Display Error Messages for Invalid Form Submission

Navigate to the wish form.
Fill out the form with invalid data (e.g., missing required fields).
Submit the form.
✅❓❌⬜ AC1: Verify that appropriate error messages are displayed for each invalid input.
Test Case 2: Display Validation Messages

Navigate to the wish form.
Fill out the form with data that requires validation (e.g., email format).
Submit the form.
✅❓❌⬜ AC2: Verify that validation messages are displayed as expected.

Optional fields:

  • Phab ticket

All form validation language should follow convention of codex principles.

Relevant figma: https://www.figma.com/design/JcTMFwbEJPpCKBiZ16Jkel/Future-of-the-Wishlist?node-id=1368-14631&t=CrKXOpbCpA53k5z5-0

QA Results - Wishlist-test.toolforge

ACStatusDetails
1T363218#9974766

Event Timeline

JWheeler-WMF renamed this task from Error states: form to Error /validation states: wish form.Apr 23 2024, 8:19 PM
JSengupta-WMF changed the task status from Open to In Progress.EditedMay 29 2024, 10:23 AM
JSengupta-WMF subscribed.

General error states example here

Intake Form error.jpg (2×1 px, 687 KB)

Here are the specific error messages as per the ticket description

  • Title 10+ characters, max 70: "Title must be between 10 - 70 characters long."
  • Description: 50+ characters: "Description must be at least 50 characters long."
  • Idea type Select 1: "Select an idea type."
  • Project(s) Select 1 or enter something else (something else needs 3+ characters): "Select at least one related project." if other is selected and too short then "External project name must be at least 3 characters long."
  • Impacted users: 10+ characters: "Impacted user must be at least 10 characters long."
  • Error under the submit button: "Please complete all the mandatory fields before submitting this idea or save it as a draft to complete later."
JWheeler-WMF raised the priority of this task from Medium to High.Jun 5 2024, 3:17 PM
KSiebert added a subscriber: TheresNoTime.

We are not implementing error validation states anymore.
As per the decision made on June 5th, 2024.
Reason: this is extra scope. While it is an optimization and potentially better UX, we don't know how users will interact with the form, and users will still be able to "draft" wishes in their sandbox environments. We can implement draft mode as a fast follow.

Change: Error validations states have become important again as we don't have a draft mode.

Copying outstanding issues in case it wasn't seen over on GitLab:

  • There doesn't appear to any error message about the description being too short. The submit button is correctly disabled when it's less than 50 characters, but I'm not informed as to why it is disabled. Also there's no error state (red border).
  • "Primary affected users" appears to have a minimum length of 5 characters, but the message says it's a minimum of 3 characters.
  • Interestingly the error for the title field only shows when I use the Backspace key. If I go to create a new wish, enter only 3 characters in the title then blur out, the field has the error state but no message is shown.
  • I appear to be able to submit a wish without selecting a project or adding a value to the "It's something else" field.

Also, button text should be "Publish wish". Field level validation shouldn't happen when a user jumps to the next field but only after clicking the Publish wish button.

@JSengupta-WMF I think I saw you mention elsewhere that we may want to change the validation for the proposal title to 5 < length > 150?

  • "Primary affected users" appears to have a minimum length of 5 characters, but the message says it's a minimum of 3 characters.

There also does not seem to be an upper limit to the amount of text in that input, even though the validation messages says maximum is 300.

musikanimal opened https://gitlab.wikimedia.org/repos/commtech/wishlist-intake/-/merge_requests/150

i18n: use PLURAL and provide numbers instead of hardcoding in the msg

samwilson merged https://gitlab.wikimedia.org/repos/commtech/wishlist-intake/-/merge_requests/150

i18n: use PLURAL and provide numbers instead of hardcoding in the msg

@TheresNoTime Please review the following issues below, thanks!

Test Result - Wishlist-test.toolforge

Status: ❌ FAIL
Environment: Wishlist-test.toolforge
OS: macOS Sonoma 14.5
Browser: Chrome 126
Device: MBA
Emulated Device: NA

Test Artifact(s):

Test Steps

Test Case 1: Display Error Messages for Invalid Form Submission

Navigate to the wish form.
Fill out the form with invalid data (e.g., missing required fields).
Submit the form.
❌AC1: Verify that appropriate error messages are displayed for each invalid input.
Test Case 2: Display Validation Messages

No error message when no project was selected
2024-07-08_10-07-09.png (1×1 px, 179 KB)

Navigate to the wish form.
Fill out the form with data that requires validation (e.g., email format).
Submit the form.
❌AC2: Verify that validation messages are displayed as expected.

Met the criteria above but still got error states
2024-07-08_09-54-17.png (1×1 px, 231 KB)

❓Potential Issue

Shouldn't it not be "Saved Changes" if all criteria have been met to what it was previously like "Publish" or whatever it was before
2024-07-08_10-03-26.png (1×1 px, 219 KB)

AC1/AC2 were issues caused by a different (now fixed) bug

image.png (378×1 px, 56 KB)

image.png (123×1 px, 12 KB)

@TheresNoTime Issues have now been resolved as seen in the screenshots. I will move this to Done. Thanks for all your work!

Test Result - Wishlist-test.toolforge

Status: ✅ PASS
Environment: Wishlist-test.toolforge
OS: macOS Sonoma 14.5
Browser: Chrome 126
Device: MBA
Emulated Device: NA

Test Artifact(s):

Test Steps

Test Case 1: Display Error Messages for Invalid Form Submission

  1. Navigate to the wish form.
  2. Fill out the form with invalid data (e.g., missing required fields).
  3. Submit the form.

✅AC1: Verify that appropriate error messages are displayed for each invalid input.

All ErrorsWishlist underWishlist OverPrimary Users UnderPrimary Users Over
2024-07-11_10-18-18.png (1×1 px, 212 KB)
2024-07-11_10-47-25.png (354×1 px, 74 KB)
2024-07-11_10-22-05.png (1×2 px, 277 KB)
2024-07-11_10-23-42.png (286×745 px, 35 KB)
2024-07-11_10-24-27.png (1×2 px, 274 KB)

Test Case 2: Display Validation Messages

  1. Navigate to the wish form.
  2. Fill out the form with data that requires validation (e.g., email format).
  3. Submit the form.

✅AC2: Verify that validation messages are displayed as expected.

Describe meets criteriaWishlist meets criteriaTypes and Projects meets criteriaAll meets criteria
2024-07-11_10-19-42.png (1×2 px, 278 KB)
2024-07-11_10-18-59.png (1×1 px, 193 KB)
2024-07-11_10-23-08.png (1×1 px, 198 KB)
2024-07-11_10-26-55.png (765×1 px, 114 KB)