Skip to content

Commit e0d1712

Browse files
testing numeric value in minduration
1 parent 2577513 commit e0d1712

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

test/end-to-end/offer.js

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -232,13 +232,6 @@ describe("Offer endpoint tests", () => {
232232
FieldValidatorTester.mustBeFuture();
233233
FieldValidatorTester.mustBeAfter("publishDate");
234234
});
235-
describe("jobMinDuration", () => {
236-
const FieldValidatorTester = BodyValidatorTester("jobMinDuration");
237-
if (BodyValidatorTester("jobType") !== "FREELANCE") {
238-
FieldValidatorTester.isRequired();
239-
FieldValidatorTester.mustBeNumber();
240-
}
241-
});
242235
describe("jobMaxDuration", () => {
243236
const FieldValidatorTester = BodyValidatorTester("jobMaxDuration");
244237
FieldValidatorTester.isRequired();
@@ -707,6 +700,19 @@ describe("Offer endpoint tests", () => {
707700
expect(res.status).toBe(HTTPStatus.UNPROCESSABLE_ENTITY);
708701
});
709702

703+
test("should fail jobMinDuration isn't numeric value", async () => {
704+
const offer_params = generateTestOffer({
705+
jobMaxDuration: 8,
706+
jobMinDuration: "nonNumeric",
707+
owner: test_company._id,
708+
});
709+
const res = await request()
710+
.post("/offers/new")
711+
.send(withGodToken(offer_params));
712+
expect(res.status).toBe(HTTPStatus.UNPROCESSABLE_ENTITY);
713+
});
714+
715+
710716
test("should succeed if jobMaxDuration is greater than jobMinDuration", async () => {
711717
const offer_params = generateTestOffer({
712718
jobMinDuration: 8,

0 commit comments

Comments
 (0)