forked from Yara724/api
HOTFIX: not allowing empty price when expert tries to submit
This commit is contained in:
19
src/helpers/expert-reply-pricing.spec.ts
Normal file
19
src/helpers/expert-reply-pricing.spec.ts
Normal 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();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user