diff --git a/packages/zod-form-adapter/tests/FormApi.spec.ts b/packages/zod-form-adapter/tests/FormApi.spec.ts index 51cff8f64..0f3667691 100644 --- a/packages/zod-form-adapter/tests/FormApi.spec.ts +++ b/packages/zod-form-adapter/tests/FormApi.spec.ts @@ -17,16 +17,20 @@ describe('zod form api', () => { form, name: 'name', validators: { - onChange: z.string().min(3, 'You must have a length of at least 3'), + onChange: z + .string() + .min(3, 'You must have a length of at least 3') + .regex(/^[a-z]+$/i, 'You must have only letters'), }, }) field.mount() expect(field.getMeta().errors).toEqual([]) - field.setValue('a') + field.setValue('#') // too short and invalid character expect(field.getMeta().errors).toEqual([ 'You must have a length of at least 3', + 'You must have only letters', ]) field.setValue('asdf') expect(field.getMeta().errors).toEqual([])