Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: can toggle feedback required and show validation errors #3939

Merged
merged 6 commits into from
Nov 12, 2024

Conversation

jamdelion
Copy link
Contributor

@jamdelion jamdelion commented Nov 12, 2024

In this PR:

  • Added validation schema for public feedback component (make fields required if 'feedback required' toggle is true)
  • Show error messages if required fields not filled in
  • Added test coverage for these scenarios, including splitting public.test.tsx into two test files (one for accessibility, one for submission tests)

Screenshot 2024-11-12 at 14 45 36

@jamdelion jamdelion changed the title jh/feedback testing feat: can toggle feedback required and show validation errors Nov 12, 2024
@jamdelion jamdelion marked this pull request as ready for review November 12, 2024 14:50
@jamdelion jamdelion requested a review from a team November 12, 2024 14:50
Copy link

github-actions bot commented Nov 12, 2024

Removed vultr server and associated DNS entries

Copy link
Member

@jessicamcinchak jessicamcinchak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor comment but overall works as expected & thanks for clear test coverage !!

: number()
.integer()
.min(1, "Feedback score must be at least 1")
.max(5, "Feedback score cannot exceed 5"),
Copy link
Member

@jessicamcinchak jessicamcinchak Nov 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: while this validation schema is totally correct, are min & max actually useful user-facing errors here since the user is interacting with a set of emoji expressions rather than inputing a number score? Basically I think I'd vote .required() or undefined is plenty here?

Also perhaps "Please rate your experience" would better align to default label text rather than "Please provide a feedback score" ?

@jamdelion jamdelion merged commit 2c8eaf3 into main Nov 12, 2024
12 checks passed
@jamdelion jamdelion deleted the jh/feedback-testing branch November 12, 2024 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants