test(orders): add validation test for missing datetime_end in order creation
This commit is contained in:
parent
f7c21d5c01
commit
5451fe79ed
@ -274,6 +274,21 @@ describe('OrdersService', () => {
|
||||
await expect(result).rejects.toThrow(ERRORS.MISSING_START_TIME);
|
||||
});
|
||||
|
||||
it('should throw error when datetime_end is missing', async () => {
|
||||
const variablesWithoutEnd = {
|
||||
input: {
|
||||
client: 'customer-123',
|
||||
datetime_start: now.toISOString(),
|
||||
services: ['service-123'],
|
||||
slot: 'slot-123',
|
||||
},
|
||||
};
|
||||
|
||||
const result = ordersService.createOrder(variablesWithoutEnd);
|
||||
|
||||
await expect(result).rejects.toThrow(ERRORS.MISSING_END_TIME);
|
||||
});
|
||||
|
||||
it('should throw error when client is missing', async () => {
|
||||
const variablesWithoutClient = {
|
||||
input: {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user