mirror of
https://github.com/strapi/strapi.git
synced 2025-12-28 07:33:17 +00:00
Addressed PR comments to check throw messages
This commit is contained in:
parent
4220909c81
commit
f8c0cd7052
@ -60,10 +60,18 @@ describe('parseType', () => {
|
||||
});
|
||||
|
||||
it('Throws on invalid formator dates', () => {
|
||||
expect(() => parseType({ type: 'date', value: '-1029-11-02' })).toThrow();
|
||||
expect(() => parseType({ type: 'date', value: '2019-13-02' })).toThrow();
|
||||
expect(() => parseType({ type: 'date', value: '2019-12-32' })).toThrow();
|
||||
expect(() => parseType({ type: 'date', value: '2019-02-31' })).toThrow();
|
||||
expect(() => parseType({ type: 'date', value: '-1029-11-02' })).toThrow(
|
||||
'Invalid format, expected an ISO compatible date'
|
||||
);
|
||||
expect(() => parseType({ type: 'date', value: '2019-13-02' })).toThrow(
|
||||
'Invalid format, expected an ISO compatible date'
|
||||
);
|
||||
expect(() => parseType({ type: 'date', value: '2019-12-32' })).toThrow(
|
||||
'Invalid format, expected an ISO compatible date'
|
||||
);
|
||||
expect(() => parseType({ type: 'date', value: '2019-02-31' })).toThrow(
|
||||
'Invalid format, expected an ISO compatible date'
|
||||
);
|
||||
});
|
||||
|
||||
it('Throws on incorrect dates and checks the error message', () => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user