Skip to content

Commit

Permalink
fix(app): fix error from pasting in code
Browse files Browse the repository at this point in the history
  • Loading branch information
Demwunz committed May 16, 2024
1 parent 747d4a1 commit 64b40b2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,13 @@ async function go (sessionId, payload, yar) {

/**
* When a single agreement and exception is checked by the user, it returns as a string. When multiple agreements and
* exceptions are checked, the 'agreementsExceptions' is returned as an array. This function works to make those single
* selected string 'agreementsExceptions' into an array for uniformity.
* exceptions are checked, the 'additionalSubmissionOptions' is returned as an array.
* This function works to make those single
* selected string 'additionalSubmissionOptions' into an array for uniformity.
*/
function _handleOneOptionSelected (payload) {
if (!Array.isArray(payload.agreementsExceptions)) {
payload.agreementsExceptions = [payload.agreementsExceptions]
if (!Array.isArray(payload.additionalSubmissionOptions)) {
payload.additionalSubmissionOptions = [payload.additionalSubmissionOptions]
}
}

Expand Down
2 changes: 1 addition & 1 deletion app/views/return-requirements/check.njk
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
classes: "govuk-body "
},
value: {
text: 'Yes' if additionalSubmissionOptions.includes('multiple-upload') else "No"
text: 'Yes' if additionalSubmissionOptions.includes('multiple-upload') else "No"
}
}
]
Expand Down
2 changes: 1 addition & 1 deletion test/controllers/return-requirements.controller.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ describe('Return requirements controller', () => {

describe('when the request succeeds', () => {
it('returns the page successfully', async () => {
const response = await server.inject(_options('additionalSubmissionOptions'))
const response = await server.inject(_options('additional-submission-options'))

expect(response.statusCode).to.equal(200)
expect(response.payload).to.contain('Select any additional submission options for the return requirements')
Expand Down

0 comments on commit 64b40b2

Please sign in to comment.