Skip to content

Commit

Permalink
rename templates folder
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorgeGoodall committed Jul 9, 2024
1 parent 9c0836e commit 0736a5b
Show file tree
Hide file tree
Showing 30 changed files with 71 additions and 40 deletions.
5 changes: 3 additions & 2 deletions src/routes/form-wizard/check/steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -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': {
Expand Down Expand Up @@ -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'
}
}
7 changes: 4 additions & 3 deletions src/routes/form-wizard/endpoint-submission-form/steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -43,6 +43,7 @@ export default {
backLink: '/dataset-details'
},
'/confirmation': {
...defaultParams
...defaultParams,
template: 'submit/confirmation.html'
}
}
4 changes: 2 additions & 2 deletions src/serverSetup/nunjucks.js
Original file line number Diff line number Diff line change
Expand Up @@ -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/'
], {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
29 changes: 29 additions & 0 deletions test/unit/check/confirmationPage.test.js
Original file line number Diff line number Diff line change
@@ -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('<h1 class="govuk-panel__title".*A Mock dataset submitted.*</h1>', 'g')
expect(html).toMatch(regex)
})
})
29 changes: 0 additions & 29 deletions test/unit/confirmationPage.test.js

This file was deleted.

29 changes: 29 additions & 0 deletions test/unit/endpointSubmissionForm/confirmationPage.test.js
Original file line number Diff line number Diff line change
@@ -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('<h1 class="govuk-panel__title".*A Mock dataset submitted.*</h1>', 'g')
expect(html).toMatch(regex)
})
})
4 changes: 2 additions & 2 deletions test/unit/errorsPage.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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/'
], {
Expand Down
4 changes: 2 additions & 2 deletions test/unit/noErrorsPage.test.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0736a5b

Please sign in to comment.