diff --git a/app/services/return-requirements/submit-additional-submission-options.service.js b/app/services/return-requirements/submit-additional-submission-options.service.js index 4977999cdb..72a3bfa92a 100644 --- a/app/services/return-requirements/submit-additional-submission-options.service.js +++ b/app/services/return-requirements/submit-additional-submission-options.service.js @@ -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] } } diff --git a/app/views/return-requirements/check.njk b/app/views/return-requirements/check.njk index b1ff9a928f..6e91c9a756 100644 --- a/app/views/return-requirements/check.njk +++ b/app/views/return-requirements/check.njk @@ -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" } } ] diff --git a/test/controllers/return-requirements.controller.test.js b/test/controllers/return-requirements.controller.test.js index 4668ac6c08..bf69b2667f 100644 --- a/test/controllers/return-requirements.controller.test.js +++ b/test/controllers/return-requirements.controller.test.js @@ -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')