Skip to content

Commit

Permalink
Merge pull request #550 from UKHSA-Internal/bug/feedback-page-validation
Browse files Browse the repository at this point in the history
Title-case enum values for yes/no question
  • Loading branch information
A-Ashiq authored Nov 19, 2024
2 parents 34aecc4 + e1ab284 commit 5606875
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/api/requests/suggestions/postSuggestions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ test('Handles successful submission from the api', async () => {

const { success } = await postSuggestions({
what_was_your_reason_for_visiting_the_dashboard_today: '',
did_you_find_everything_you_were_looking_for: 'yes',
did_you_find_everything_you_were_looking_for: 'Yes',
how_could_we_improve_your_experience_with_the_dashboard: '',
what_would_you_like_to_see_on_the_dashboard_in_the_future: '',
})
Expand Down
2 changes: 1 addition & 1 deletion src/schemas/feedback.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as z from 'zod'
export const feedbackSchema = z
.object({
what_was_your_reason_for_visiting_the_dashboard_today: z.string().optional().nullable(),
did_you_find_everything_you_were_looking_for: z.enum(['yes', 'no']).or(z.undefined()),
did_you_find_everything_you_were_looking_for: z.enum(['Yes', 'No']).or(z.undefined()),
how_could_we_improve_your_experience_with_the_dashboard: z.string().optional().nullable(),
what_would_you_like_to_see_on_the_dashboard_in_the_future: z.string().optional().nullable(),
})
Expand Down

1 comment on commit 5606875

@github-actions
Copy link

Choose a reason for hiding this comment

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

Unit tests coverage

Lines Statements Branches Functions
Coverage: 93%
92.08% (1768/1920) 82.22% (407/495) 89.31% (259/290)
Tests Skipped Failures Errors Time
470 0 💤 0 ❌ 0 🔥 15.957s ⏱️

Please sign in to comment.