forked from Yara724/api
HOTFIX: not allowing empty price when expert tries to submit
This commit is contained in:
27
src/expert-claim/dto/expert-claim-v2.dto.spec.ts
Normal file
27
src/expert-claim/dto/expert-claim-v2.dto.spec.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
import { plainToInstance } from "class-transformer";
|
||||
import { validate } from "class-validator";
|
||||
import { DaghiOption } from "src/Types&Enums/claim-request-management/daghi-option.enum";
|
||||
import { SubmitExpertReplyV2Dto } from "./expert-claim-v2.dto";
|
||||
|
||||
describe("SubmitExpertReplyV2Dto", () => {
|
||||
it("rejects a selected damaged part with blank pricing", async () => {
|
||||
const dto = plainToInstance(SubmitExpertReplyV2Dto, {
|
||||
description: "Damage assessment",
|
||||
parts: [
|
||||
{
|
||||
partId: 201,
|
||||
typeOfDamage: "Minor",
|
||||
price: "",
|
||||
salary: "",
|
||||
totalPayment: "",
|
||||
factorNeeded: false,
|
||||
daghi: { option: DaghiOption.NO_VALUE },
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
const errors = await validate(dto);
|
||||
|
||||
expect(errors).not.toHaveLength(0);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user