Skip to content

Commit

Permalink
Update validation msg for ret. req. copy existing (#1112)
Browse files Browse the repository at this point in the history
https://eaflood.atlassian.net/browse/WATER-4283

> Part of the work to replace NALD for handling return requirements

In [Complete Select existing return requirement page](#895) we added the controls and logic to enable a user to copy the return requirements from an existing return version into the session.

The H1 title we used though was though to be wrong. So, we [Correct copy existing return req. page title](#1092). When we did that, we also updated the validation message as all our current messages just replay the H1 title.

Again, however, this was thought to be incorrect. Our UAT team has decided the message we should show when an option is not selected is **Select a previous requirements for returns**.

This is that change.
  • Loading branch information
Cruikshanks authored Jun 18, 2024
1 parent 4d94e5b commit 3fce32c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/validators/return-requirements/existing.validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

const Joi = require('joi')

const errorMessage = 'Use previous requirements for returns'
const errorMessage = 'Select a previous requirements for returns'

/**
* Validates data submitted for the `/return-requirements/{sessionId}/existing` page
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ describe('Return Requirements - Submit Existing service', () => {
it('includes an error for the input element', async () => {
const result = await SubmitExistingService.go(session.id, payload)

expect(result.error).to.equal({ text: 'Use previous requirements for returns' })
expect(result.error).to.equal({ text: 'Select a previous requirements for returns' })
})
})
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ describe('Existing validator', () => {

expect(result.value).to.exist()
expect(result.error).to.exist()
expect(result.error.details[0].message).to.equal('Use previous requirements for returns')
expect(result.error.details[0].message).to.equal('Select a previous requirements for returns')
})
})

Expand All @@ -46,7 +46,7 @@ describe('Existing validator', () => {

expect(result.value).to.exist()
expect(result.error).to.exist()
expect(result.error.details[0].message).to.equal('Use previous requirements for returns')
expect(result.error.details[0].message).to.equal('Select a previous requirements for returns')
})
})
})
Expand Down

0 comments on commit 3fce32c

Please sign in to comment.