Skip to content

Commit

Permalink
Merge branch 'feat/wa_polls' of github.com:glific/glific-frontend int…
Browse files Browse the repository at this point in the history
…o feat/wa_polls
  • Loading branch information
akanshaaa19 committed Feb 18, 2025
2 parents 5687a6c + 99b0b59 commit 339621b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/containers/WaGroups/WaPolls/WaPolls.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,13 @@ export const WaPolls = () => {

const FormSchema = Yup.object().shape({

Check warning on line 85 in src/containers/WaGroups/WaPolls/WaPolls.tsx

View check run for this annotation

Codecov / codecov/patch

src/containers/WaGroups/WaPolls/WaPolls.tsx#L85

Added line #L85 was not covered by tests
label: Yup.string().required(t('Title is required.')).max(50, t('Title is too long.')),
content: Yup.string().required('Content is required.').max(150, 'Content is too long.'),
content: Yup.string().required('Content is required.').max(255, 'Content is too long.'),
options: Yup.array()
.of(Yup.object().shape({ name: Yup.string().required('Option is required.') }))
.of(
Yup.object().shape({
name: Yup.string().required('Option is required.').max(100, 'Please enter not more than 100 characters'),
})
)
.test('unique-values', 'Values must be unique', (array: any) => {
const values = array.map((item: any) => item.name);
return new Set(values).size === values.length;

Check warning on line 96 in src/containers/WaGroups/WaPolls/WaPolls.tsx

View check run for this annotation

Codecov / codecov/patch

src/containers/WaGroups/WaPolls/WaPolls.tsx#L95-L96

Added lines #L95 - L96 were not covered by tests
Expand Down

0 comments on commit 339621b

Please sign in to comment.