test(orders): add validation test for missing datetime_end in order creation

This commit is contained in:
vchikalkin 2025-08-06 15:19:07 +03:00
parent f7c21d5c01
commit 5451fe79ed

View File

@ -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: {