HOTFIX: not allowing empty price when expert tries to submit

This commit is contained in:
SepehrYahyaee
2026-09-05 16:44:40 +03:30
parent 70fa49398d
commit feacad58ca
7 changed files with 200 additions and 1 deletions

View File

@@ -0,0 +1,19 @@
import { getExpertReplyPricingValidationError } from "./expert-reply-pricing";
describe("getExpertReplyPricingValidationError", () => {
it("rejects a blank pricing line", () => {
expect(
getExpertReplyPricingValidationError([
{ partId: 201, price: "", salary: "", totalPayment: "" },
]),
).toMatch(/requires valid price, salary, and totalPayment/);
});
it("accepts a fully priced line with a zero-valued split", () => {
expect(
getExpertReplyPricingValidationError([
{ partId: 201, price: "0", salary: "10000", totalPayment: "10000" },
]),
).toBeNull();
});
});