mirror of
https://github.com/strapi/strapi.git
synced 2025-08-08 08:46:42 +00:00
fix email test
This commit is contained in:
parent
c66c0dfd8f
commit
e9b64aca19
@ -42,13 +42,17 @@ describe('Email validator', () => {
|
|||||||
const validator = strapiUtils.validateYupSchema(
|
const validator = strapiUtils.validateYupSchema(
|
||||||
validators.email(
|
validators.email(
|
||||||
{
|
{
|
||||||
attr: { type: 'string', required: true },
|
attr: { type: 'string', required: true, regex: '^\\w+$' },
|
||||||
},
|
},
|
||||||
{ isDraft: false }
|
{ isDraft: false }
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
expect(await validator('valid@email.com')).not.toBe('');
|
try {
|
||||||
|
await validator('');
|
||||||
|
} catch (err) {
|
||||||
|
expect(err).toBeInstanceOf(YupValidationError);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user