@@ -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