diff --git a/src/routes/form-wizard/check/steps.js b/src/routes/form-wizard/check/steps.js index 938356b9..eee307c8 100644 --- a/src/routes/form-wizard/check/steps.js +++ b/src/routes/form-wizard/check/steps.js @@ -17,7 +17,7 @@ export default { entryPoint: true, resetJourney: true, next: 'dataset', - template: '../views/checkPages/start.html', + template: '../views/check/start.html', noPost: true }, // '/data-subject': { @@ -88,6 +88,7 @@ export default { '/confirmation': { ...baseSettings, noPost: true, - checkJourney: false // ToDo: it would be useful here if we make sure they have selected if their results are ok from the previous step + checkJourney: false, // ToDo: it would be useful here if we make sure they have selected if their results are ok from the previous step + template: 'check/confirmation.html' } } diff --git a/src/routes/form-wizard/endpoint-submission-form/steps.js b/src/routes/form-wizard/endpoint-submission-form/steps.js index b2554485..edbf8cd6 100644 --- a/src/routes/form-wizard/endpoint-submission-form/steps.js +++ b/src/routes/form-wizard/endpoint-submission-form/steps.js @@ -14,8 +14,8 @@ export default { entryPoint: true, resetJourney: true, noPost: true, - template: '../views/endpointSubmissionFormPages/start.html', - next: '/submit/lpa-details' + template: 'submit/start.html', + next: 'submit/lpa-details' }, '/lpa-details': { ...defaultParams, @@ -43,6 +43,7 @@ export default { backLink: '/dataset-details' }, '/confirmation': { - ...defaultParams + ...defaultParams, + template: 'submit/confirmation.html' } } diff --git a/src/serverSetup/nunjucks.js b/src/serverSetup/nunjucks.js index 458f8e04..5a7a20e8 100644 --- a/src/serverSetup/nunjucks.js +++ b/src/serverSetup/nunjucks.js @@ -9,8 +9,8 @@ export function setupNunjucks ({ app, dataSubjects }) { const nunjucksEnv = nunjucks.configure([ 'src/views', - 'src/views/checkPages', - 'src/views/endpointSubmissionFormPages', + 'src/views/check', + 'src/views/submit', 'node_modules/govuk-frontend/dist/', 'node_modules/@x-govuk/govuk-prototype-components/' ], { diff --git a/src/views/checkPages/check-answers.html b/src/views/check/check-answers.html similarity index 100% rename from src/views/checkPages/check-answers.html rename to src/views/check/check-answers.html diff --git a/src/views/checkPages/confirmation.html b/src/views/check/confirmation.html similarity index 100% rename from src/views/checkPages/confirmation.html rename to src/views/check/confirmation.html diff --git a/src/views/checkPages/data-subject.html b/src/views/check/data-subject.html similarity index 100% rename from src/views/checkPages/data-subject.html rename to src/views/check/data-subject.html diff --git a/src/views/checkPages/dataset.html b/src/views/check/dataset.html similarity index 100% rename from src/views/checkPages/dataset.html rename to src/views/check/dataset.html diff --git a/src/views/checkPages/geometry-type.html b/src/views/check/geometry-type.html similarity index 100% rename from src/views/checkPages/geometry-type.html rename to src/views/check/geometry-type.html diff --git a/src/views/checkPages/results/errors.html b/src/views/check/results/errors.html similarity index 100% rename from src/views/checkPages/results/errors.html rename to src/views/check/results/errors.html diff --git a/src/views/checkPages/results/failedFileRequest.html b/src/views/check/results/failedFileRequest.html similarity index 100% rename from src/views/checkPages/results/failedFileRequest.html rename to src/views/check/results/failedFileRequest.html diff --git a/src/views/checkPages/results/failedUrlRequest.html b/src/views/check/results/failedUrlRequest.html similarity index 100% rename from src/views/checkPages/results/failedUrlRequest.html rename to src/views/check/results/failedUrlRequest.html diff --git a/src/views/checkPages/results/no-errors.html b/src/views/check/results/no-errors.html similarity index 100% rename from src/views/checkPages/results/no-errors.html rename to src/views/check/results/no-errors.html diff --git a/src/views/checkPages/start.html b/src/views/check/start.html similarity index 100% rename from src/views/checkPages/start.html rename to src/views/check/start.html diff --git a/src/views/checkPages/statusPage/checkingFileMacro.html b/src/views/check/statusPage/checkingFileMacro.html similarity index 100% rename from src/views/checkPages/statusPage/checkingFileMacro.html rename to src/views/check/statusPage/checkingFileMacro.html diff --git a/src/views/checkPages/statusPage/fileCheckedMacro.html b/src/views/check/statusPage/fileCheckedMacro.html similarity index 100% rename from src/views/checkPages/statusPage/fileCheckedMacro.html rename to src/views/check/statusPage/fileCheckedMacro.html diff --git a/src/views/checkPages/statusPage/status.html b/src/views/check/statusPage/status.html similarity index 100% rename from src/views/checkPages/statusPage/status.html rename to src/views/check/statusPage/status.html diff --git a/src/views/checkPages/upload-method.html b/src/views/check/upload-method.html similarity index 100% rename from src/views/checkPages/upload-method.html rename to src/views/check/upload-method.html diff --git a/src/views/checkPages/upload.html b/src/views/check/upload.html similarity index 100% rename from src/views/checkPages/upload.html rename to src/views/check/upload.html diff --git a/src/views/checkPages/url.html b/src/views/check/url.html similarity index 100% rename from src/views/checkPages/url.html rename to src/views/check/url.html diff --git a/src/views/endpointSubmissionFormPages/check.html b/src/views/submit/check.html similarity index 100% rename from src/views/endpointSubmissionFormPages/check.html rename to src/views/submit/check.html diff --git a/src/views/endpointSubmissionFormPages/choose-dataset.html b/src/views/submit/choose-dataset.html similarity index 100% rename from src/views/endpointSubmissionFormPages/choose-dataset.html rename to src/views/submit/choose-dataset.html diff --git a/src/views/endpointSubmissionFormPages/confirmation.html b/src/views/submit/confirmation.html similarity index 100% rename from src/views/endpointSubmissionFormPages/confirmation.html rename to src/views/submit/confirmation.html diff --git a/src/views/endpointSubmissionFormPages/dataset-details.html b/src/views/submit/dataset-details.html similarity index 100% rename from src/views/endpointSubmissionFormPages/dataset-details.html rename to src/views/submit/dataset-details.html diff --git a/src/views/endpointSubmissionFormPages/lpa-details.html b/src/views/submit/lpa-details.html similarity index 100% rename from src/views/endpointSubmissionFormPages/lpa-details.html rename to src/views/submit/lpa-details.html diff --git a/src/views/endpointSubmissionFormPages/start.html b/src/views/submit/start.html similarity index 100% rename from src/views/endpointSubmissionFormPages/start.html rename to src/views/submit/start.html diff --git a/test/unit/check/confirmationPage.test.js b/test/unit/check/confirmationPage.test.js new file mode 100644 index 00000000..8a668ffa --- /dev/null +++ b/test/unit/check/confirmationPage.test.js @@ -0,0 +1,29 @@ +/* eslint-disable prefer-regex-literals */ + +import { describe, expect, it } from 'vitest' +import { setupNunjucks } from '../../../src/serverSetup/nunjucks.js' +import { runGenericPageTests } from '../generic-page.js' +import config from '../../../config/index.js' +import { stripWhitespace } from '../../utils/stripWhiteSpace.js' +import { mockDataSubjects } from '../data.js' + +const nunjucks = setupNunjucks({ dataSubjects: mockDataSubjects }) + +describe('Check confirmation View', () => { + const params = { + values: { + dataset: 'mockDataset' + } + } + const html = stripWhitespace(nunjucks.render('submit/confirmation.html', params)) + + runGenericPageTests(html, { + pageTitle: 'A Mock dataset submitted - Submit planning and housing data for England', + serviceName: config.serviceName + }) + + it('should render the gov uk panel', () => { + const regex = new RegExp('

', 'g') + expect(html).toMatch(regex) + }) +}) diff --git a/test/unit/confirmationPage.test.js b/test/unit/confirmationPage.test.js deleted file mode 100644 index 8db535e6..00000000 --- a/test/unit/confirmationPage.test.js +++ /dev/null @@ -1,29 +0,0 @@ -/* eslint-disable prefer-regex-literals */ - -import { describe, expect, it } from 'vitest' -import { setupNunjucks } from '../../src/serverSetup/nunjucks.js' -import { runGenericPageTests } from './generic-page.js' -import config from '../../config/index.js' -import { stripWhitespace } from '../utils/stripWhiteSpace.js' -import { mockDataSubjects } from './data.js' - -const nunjucks = setupNunjucks({ dataSubjects: mockDataSubjects }) - -describe('Confirmation View', () => { - const params = { - values: { - dataset: 'mockDataset' - } - } - const html = stripWhitespace(nunjucks.render('confirmation.html', params)) - - runGenericPageTests(html, { - pageTitle: 'A Mock dataset submitted - Check planning and housing data for England', - serviceName: config.serviceName - }) - - it('should render the gov uk panel', () => { - const regex = new RegExp('

', 'g') - expect(html).toMatch(regex) - }) -}) diff --git a/test/unit/endpointSubmissionForm/confirmationPage.test.js b/test/unit/endpointSubmissionForm/confirmationPage.test.js new file mode 100644 index 00000000..cc624949 --- /dev/null +++ b/test/unit/endpointSubmissionForm/confirmationPage.test.js @@ -0,0 +1,29 @@ +/* eslint-disable prefer-regex-literals */ + +import { describe, expect, it } from 'vitest' +import { setupNunjucks } from '../../../src/serverSetup/nunjucks.js' +import { runGenericPageTests } from '../generic-page.js' +import config from '../../../config/index.js' +import { stripWhitespace } from '../../utils/stripWhiteSpace.js' +import { mockDataSubjects } from '../data.js' + +const nunjucks = setupNunjucks({ dataSubjects: mockDataSubjects }) + +describe('Submit confirmation View', () => { + const params = { + values: { + dataset: 'mockDataset' + } + } + const html = stripWhitespace(nunjucks.render('submit/confirmation.html', params)) + + runGenericPageTests(html, { + pageTitle: 'A Mock dataset submitted - Submit planning and housing data for England', + serviceName: config.serviceName + }) + + it('should render the gov uk panel', () => { + const regex = new RegExp('

', 'g') + expect(html).toMatch(regex) + }) +}) diff --git a/test/unit/errorsPage.test.js b/test/unit/errorsPage.test.js index 5f734df7..722e13b4 100644 --- a/test/unit/errorsPage.test.js +++ b/test/unit/errorsPage.test.js @@ -11,8 +11,8 @@ import paginationTemplateTests from './paginationTemplateTests.js' const nunjucksEnv = nunjucks.configure([ 'src/views', - 'src/views/checkPages', - 'src/views/endpointSubmissionFormPages', + 'src/views/check', + 'src/views/submit', 'node_modules/govuk-frontend/dist/', 'node_modules/@x-govuk/govuk-prototype-components/' ], { diff --git a/test/unit/noErrorsPage.test.js b/test/unit/noErrorsPage.test.js index 79a59437..87783c43 100644 --- a/test/unit/noErrorsPage.test.js +++ b/test/unit/noErrorsPage.test.js @@ -11,8 +11,8 @@ import paginationTemplateTests from './paginationTemplateTests.js' const nunjucksEnv = nunjucks.configure([ 'src/views', - 'src/views/checkPages', - 'src/views/endpointSubmissionFormPages', + 'src/views/check', + 'src/views/submit', 'node_modules/govuk-frontend/dist/', 'node_modules/@x-govuk/govuk-prototype-components/' ], {