From 14c8deff20f963cc7ca5f750ef2e8b60ad1ebecb Mon Sep 17 00:00:00 2001 From: jose-carlos-sousa <2409jmsousa@gmail.com> Date: Tue, 20 Feb 2024 13:09:35 +0000 Subject: [PATCH] changed test --- test/end-to-end/offer.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/test/end-to-end/offer.js b/test/end-to-end/offer.js index ff2572c3..8dc40668 100644 --- a/test/end-to-end/offer.js +++ b/test/end-to-end/offer.js @@ -232,7 +232,21 @@ describe("Offer endpoint tests", () => { FieldValidatorTester.mustBeFuture(); FieldValidatorTester.mustBeAfter("publishDate"); }); - + describe("jobMinDuration", () => { + const FieldValidatorTester = BodyValidatorTester("jobMinDuration"); + if (BodyValidatorTester("jobType") !== "freelance") { + FieldValidatorTester.isRequired(); + FieldValidatorTester.mustBeNumber(); + } + }); + describe("jobMaxDuration", () => { + const FieldValidatorTester = BodyValidatorTester("jobMaxDuration"); + if (BodyValidatorTester("jobType") !== "freelance") { + FieldValidatorTester.isRequired(); + FieldValidatorTester.mustBeNumber(); + FieldValidatorTester.mustBeGreaterThanOrEqualToField("jobMinDuration"); + } + }); describe("jobStartDate", () => { const FieldValidatorTester = BodyValidatorTester("jobStartDate"); FieldValidatorTester.mustBeDate();