File tree Expand file tree Collapse file tree 2 files changed +1
-20
lines changed Expand file tree Collapse file tree 2 files changed +1
-20
lines changed Original file line number Diff line number Diff line change @@ -60,12 +60,10 @@ module.exports = [
6060 } ) ;
6161 let result ;
6262
63- // Validate startDate and endDate to be within the timeline startDate and endDate
63+ // Validate startDate is not earlier than timeline startDate
6464 let error ;
6565 if ( req . body . param . startDate < req . timeline . startDate ) {
6666 error = 'Milestone startDate must not be before the timeline startDate' ;
67- } else if ( req . body . param . endDate && req . timeline . endDate && req . body . param . endDate > req . timeline . endDate ) {
68- error = 'Milestone endDate must not be after the timeline endDate' ;
6967 }
7068 if ( error ) {
7169 const apiErr = new Error ( error ) ;
Original file line number Diff line number Diff line change @@ -441,23 +441,6 @@ describe('CREATE milestone', () => {
441441 . expect ( 422 , done ) ;
442442 } ) ;
443443
444- it ( 'should return 422 if endDate is after the timeline endDate' , ( done ) => {
445- const invalidBody = {
446- param : _ . assign ( { } , body . param , {
447- endDate : '2018-06-13T00:00:00.000Z' ,
448- } ) ,
449- } ;
450-
451- request ( server )
452- . post ( '/v4/timelines/1/milestones' )
453- . set ( {
454- Authorization : `Bearer ${ testUtil . jwts . admin } ` ,
455- } )
456- . send ( invalidBody )
457- . expect ( 'Content-Type' , / j s o n / )
458- . expect ( 422 , done ) ;
459- } ) ;
460-
461444 it ( 'should return 422 if invalid timelineId param' , ( done ) => {
462445 request ( server )
463446 . post ( '/v4/timelines/0/milestones' )
You can’t perform that action at this time.
0 commit comments