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 = [
60
60
} ) ;
61
61
let result ;
62
62
63
- // Validate startDate and endDate to be within the timeline startDate and endDate
63
+ // Validate startDate is not earlier than timeline startDate
64
64
let error ;
65
65
if ( req . body . param . startDate < req . timeline . startDate ) {
66
66
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' ;
69
67
}
70
68
if ( error ) {
71
69
const apiErr = new Error ( error ) ;
Original file line number Diff line number Diff line change @@ -441,23 +441,6 @@ describe('CREATE milestone', () => {
441
441
. expect ( 422 , done ) ;
442
442
} ) ;
443
443
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
-
461
444
it ( 'should return 422 if invalid timelineId param' , ( done ) => {
462
445
request ( server )
463
446
. post ( '/v4/timelines/0/milestones' )
You can’t perform that action at this time.
0 commit comments