diff --git a/app/controllers/licences.controller.js b/app/controllers/licences.controller.js index 698070e2ff..b1b1c9a358 100644 --- a/app/controllers/licences.controller.js +++ b/app/controllers/licences.controller.js @@ -32,7 +32,17 @@ async function requirementsApproved (request, h) { }) } +async function noReturnsCheckYourAnswers (request, h) { + const { id } = request.params + + return h.view('return-requirements/no-return-check-your-answers.njk', { + activeNavBar: 'search', + licenceId: id + }) +} + module.exports = { + noReturnsCheckYourAnswers, noReturnsRequired, requirementsApproved, selectReturnStartDate diff --git a/app/routes/licence.routes.js b/app/routes/licence.routes.js index a56a24b5f0..35854f44f7 100644 --- a/app/routes/licence.routes.js +++ b/app/routes/licence.routes.js @@ -27,8 +27,19 @@ const routes = [ }, description: 'Select the start date of the return' } - }, - { + }, { + method: 'GET', + path: '/licences/{id}/no-return-check-your-answers', + handler: LicencesController.noReturnsCheckYourAnswers, + options: { + auth: { + access: { + scope: ['billing'] + } + }, + description: 'No return check your answers page' + } + }, { method: 'GET', path: '/licences/{id}/requirements-approved', handler: LicencesController.requirementsApproved, diff --git a/app/views/return-requirements/no-return-check-your-answers.njk b/app/views/return-requirements/no-return-check-your-answers.njk new file mode 100644 index 0000000000..b27d7cb4a2 --- /dev/null +++ b/app/views/return-requirements/no-return-check-your-answers.njk @@ -0,0 +1,25 @@ +{% extends 'layout.njk' %} +{% from "govuk/components/back-link/macro.njk" import govukBackLink %} +{% from "govuk/components/button/macro.njk" import govukButton %} + +{% set rootLink = "/licences/" + licenceId %} +{% block breadcrumbs %} + {# Back link #} + {{ + govukBackLink({ + text: 'back', + href: rootLink + "/select-return-start-date" + }) + }} +{% endblock %} + +{% block content %} + {# Main heading #} +
+

Check your answers

+
+ +
+ {{ govukButton({ text: "Approve returns requirements" }) }} +
+{% endblock %} diff --git a/app/views/return-requirements/select-return-start-date.njk b/app/views/return-requirements/select-return-start-date.njk index b508f313ef..9c8101b9d2 100644 --- a/app/views/return-requirements/select-return-start-date.njk +++ b/app/views/return-requirements/select-return-start-date.njk @@ -2,12 +2,13 @@ {% from "govuk/components/back-link/macro.njk" import govukBackLink %} {% from "govuk/components/button/macro.njk" import govukButton %} +{% set rootLink = "/licences/" + licenceId %} {% block breadcrumbs %} {# Back link #} {{ govukBackLink({ text: 'back', - href: "/licences/{{ licenceId }}/no-returns-required" + href: rootLink + "/no-returns-required" }) }} {% endblock %} diff --git a/test/controllers/licences.controller.test.js b/test/controllers/licences.controller.test.js index a0cbebec8c..d6881ef7c1 100644 --- a/test/controllers/licences.controller.test.js +++ b/test/controllers/licences.controller.test.js @@ -91,4 +91,24 @@ describe('Licences controller', () => { }) }) }) + + describe('GET /licences/{id}/no-return-check-your-answers', () => { + const options = { + method: 'GET', + url: '/licences/64924759-8142-4a08-9d1e-1e902cd9d316/no-return-check-your-answers', + auth: { + strategy: 'session', + credentials: { scope: ['billing'] } + } + } + + describe('when the request succeeds', () => { + it('returns the page successfully', async () => { + const response = await server.inject(options) + + expect(response.statusCode).to.equal(200) + expect(response.payload).to.contain('Check your answers') + }) + }) + }) })