Skip to content

Commit

Permalink
removed the failing tests still have to make new ones
Browse files Browse the repository at this point in the history
  • Loading branch information
jose-carlos-sousa committed Feb 15, 2024
1 parent c58395e commit d2e1df9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/api/middleware/validators/offer.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,14 @@ export const create = useExpressValidators([
.if((value, { req }) => req.body.jobType !== "FREELANCE")
.exists().withMessage(ValidationReasons.REQUIRED).bail()
.isInt().withMessage(ValidationReasons.INT),


body("jobMaxDuration", ValidationReasons.DEFAULT)
.if((value, { req }) => req.body.jobType !== "FREELANCE")
.exists().withMessage(ValidationReasons.REQUIRED).bail()
.isInt().withMessage(ValidationReasons.INT).bail()
.custom(jobMaxDurationGreaterOrEqualThanJobMinDuration),


body("jobStartDate", ValidationReasons.DEFAULT)
.optional()
Expand Down
11 changes: 0 additions & 11 deletions test/end-to-end/offer.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,17 +233,6 @@ describe("Offer endpoint tests", () => {
FieldValidatorTester.mustBeAfter("publishDate");
});

describe("jobMinDuration", () => {
const FieldValidatorTester = BodyValidatorTester("jobMinDuration");
FieldValidatorTester.mustBeNumber();
});

describe("jobMaxDuration", () => {
const FieldValidatorTester = BodyValidatorTester("jobMaxDuration");
FieldValidatorTester.mustBeNumber();
FieldValidatorTester.mustBeGreaterThanOrEqualToField("jobMinDuration");
});

describe("jobStartDate", () => {
const FieldValidatorTester = BodyValidatorTester("jobStartDate");
FieldValidatorTester.mustBeDate();
Expand Down

0 comments on commit d2e1df9

Please sign in to comment.