diff --git a/app/validators/return-requirements/start-date.validator.js b/app/validators/return-requirements/start-date.validator.js index a0b2e0c0f4..08ce638300 100644 --- a/app/validators/return-requirements/start-date.validator.js +++ b/app/validators/return-requirements/start-date.validator.js @@ -62,12 +62,12 @@ function _validateAnotherStartDate (payload, licenceStartDate, licenceEndDate) { .date() .format(['YYYY-MM-DD']) .required() - .greater(licenceStartDate) + .min(licenceStartDate) .less(licenceEndDate || '9999-12-31') .messages({ 'date.base': 'Enter a real start date', 'date.format': 'Enter a real start date', - 'date.greater': 'Start date must be after the original licence start date', + 'date.min': 'Start date must be on or after the original licence start date', 'date.less': 'Start date must be before the licence end date' }), otherwise: Joi.forbidden() diff --git a/test/validators/return-requirements/start-date.validator.test.js b/test/validators/return-requirements/start-date.validator.test.js index fab4b58e2c..b7d9e0bb0c 100644 --- a/test/validators/return-requirements/start-date.validator.test.js +++ b/test/validators/return-requirements/start-date.validator.test.js @@ -150,11 +150,11 @@ describe('Start Date validator', () => { payload['start-date-year'] = '2022' }) - it('fails validation with the message "Start date must be after the original licence start date"', () => { + it('fails validation with the message "Start date must be on or after the original licence start date"', () => { const result = StartDateValidator.go(payload, licenceStartDate, licenceEndDate) expect(result.error).to.exist() - expect(result.error.details[0].message).to.equal('Start date must be after the original licence start date') + expect(result.error.details[0].message).to.equal('Start date must be on or after the original licence start date') }) })