Skip to content

Commit 9682116

Browse files
Dependency bump (#1037)
* Bulk dependency update * remove support for definition.outputEmail * format fix * Lint fix * Lint fix * Extra coverage * Lint fix after auto-formatting --------- Co-authored-by: Jez Barnsley <jbarnsley.github@gmail.com>
1 parent 7508adf commit 9682116

9 files changed

Lines changed: 1119 additions & 1031 deletions

File tree

package-lock.json

Lines changed: 1044 additions & 994 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@
4040
},
4141
"license": "SEE LICENSE IN LICENSE",
4242
"dependencies": {
43-
"@aws-sdk/client-sns": "^3.934.0",
44-
"@defra/forms-engine-plugin": "^4.0.31",
45-
"@defra/forms-model": "^3.0.592",
46-
"@defra/hapi-tracing": "^1.29.0",
43+
"@aws-sdk/client-sns": "^3.965.0",
44+
"@defra/forms-engine-plugin": "^4.0.34",
45+
"@defra/forms-model": "^3.0.601",
46+
"@defra/hapi-tracing": "^1.30.0",
4747
"@elastic/ecs-pino-format": "^1.5.0",
4848
"@hapi/boom": "^10.0.1",
4949
"@hapi/catbox": "^12.1.1",
@@ -53,7 +53,7 @@
5353
"@hapi/hapi": "^21.4.4",
5454
"@hapi/hoek": "^11.0.7",
5555
"@hapi/inert": "^7.1.0",
56-
"@hapi/jwt": "^3.2.1",
56+
"@hapi/jwt": "^3.2.3",
5757
"@hapi/scooter": "^7.0.0",
5858
"@hapi/vision": "^7.0.3",
5959
"@hapi/wreck": "^18.1.0",
@@ -73,15 +73,15 @@
7373
"hapi-pulse": "^3.0.1",
7474
"highlight.js": "^11.11.1",
7575
"http-status-codes": "^2.3.0",
76-
"humanize-duration": "^3.33.1",
77-
"ioredis": "^5.8.2",
76+
"humanize-duration": "^3.33.2",
77+
"ioredis": "^5.9.1",
7878
"joi": "^17.13.3",
7979
"liquidjs": "^10.24.0",
8080
"lodash": "^4.17.21",
81-
"marked": "^17.0.0",
81+
"marked": "^17.0.1",
8282
"nunjucks": "^3.2.4",
8383
"pino": "^9.14.0",
84-
"pino-pretty": "^13.1.2",
84+
"pino-pretty": "^13.1.3",
8585
"proxy-agent": "^6.5.0",
8686
"resolve": "^1.22.11",
8787
"semver": "^7.7.3"
@@ -107,17 +107,17 @@
107107
"@types/hoek": "^4.1.7",
108108
"@types/jest": "^30.0.0",
109109
"@types/jsdom": "^21.1.7",
110-
"@types/lodash": "^4.17.20",
110+
"@types/lodash": "^4.17.21",
111111
"@types/mysql": "^2.15.27",
112-
"@types/node": "^24.10.1",
112+
"@types/node": "^24.10.4",
113113
"@types/nunjucks": "^3.2.6",
114114
"@types/resolve": "^1.20.6",
115115
"@types/url-parse": "^1.4.11",
116116
"@types/webpack-assets-manifest": "^5.1.4",
117117
"@types/wreck": "^14.0.5",
118-
"@typescript-eslint/eslint-plugin": "^8.47.0",
119-
"@typescript-eslint/parser": "^8.47.0",
120-
"autoprefixer": "^10.4.22",
118+
"@typescript-eslint/eslint-plugin": "^8.52.0",
119+
"@typescript-eslint/parser": "^8.52.0",
120+
"autoprefixer": "^10.4.23",
121121
"aws-sdk-client-mock": "^4.1.0",
122122
"aws-sdk-client-mock-jest": "^4.1.0",
123123
"babel-loader": "^10.0.0",
@@ -126,7 +126,7 @@
126126
"babel-plugin-transform-import-meta": "^2.3.3",
127127
"clean-webpack-plugin": "^4.0.0",
128128
"concurrently": "^9.2.1",
129-
"cookie": "^1.0.2",
129+
"cookie": "^1.1.1",
130130
"copy-webpack-plugin": "^13.0.1",
131131
"core-js": "^3.47.0",
132132
"cssnano": "^7.1.2",
@@ -137,7 +137,7 @@
137137
"eslint-config-standard": "^17.1.0",
138138
"eslint-import-resolver-typescript": "^4.4.4",
139139
"eslint-plugin-import": "^2.32.0",
140-
"eslint-plugin-jest": "^29.1.0",
140+
"eslint-plugin-jest": "^29.12.1",
141141
"eslint-plugin-jsdoc": "^51.4.1",
142142
"eslint-plugin-n": "^16.6.2",
143143
"eslint-plugin-promise": "^6.6.0",
@@ -146,23 +146,23 @@
146146
"jest": "^30.2.0",
147147
"jest-extended": "^6.0.0",
148148
"jsdom": "^26.1.0",
149-
"lint-staged": "^16.2.6",
149+
"lint-staged": "^16.2.7",
150150
"outdent": "^0.8.0",
151151
"postcss": "^8.5.6",
152152
"postcss-load-config": "^6.0.1",
153153
"postcss-loader": "^8.2.0",
154154
"postcss-scss": "^4.0.9",
155-
"prettier": "^3.6.2",
156-
"sass-embedded": "^1.93.3",
155+
"prettier": "^3.7.4",
156+
"sass-embedded": "^1.97.2",
157157
"sass-loader": "^16.0.6",
158158
"source-map-loader": "^5.0.0",
159-
"stylelint": "^16.25.0",
159+
"stylelint": "^16.26.1",
160160
"stylelint-config-gds": "^2.0.0",
161-
"terser-webpack-plugin": "^5.3.14",
162-
"tsx": "^4.20.6",
161+
"terser-webpack-plugin": "^5.3.16",
162+
"tsx": "^4.21.0",
163163
"typescript": "^5.9.3",
164-
"webpack": "^5.103.0",
165-
"webpack-assets-manifest": "^6.4.0",
164+
"webpack": "^5.104.1",
165+
"webpack-assets-manifest": "^6.5.0",
166166
"webpack-cli": "^6.0.1"
167167
}
168168
}

src/server/plugins/nunjucks/context.test.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,8 @@ describe('Nunjucks context', () => {
3131
const { config } = await import('~/src/config/index.js')
3232

3333
// Import when isolated to avoid cache
34-
const { context } = await import(
35-
'~/src/server/plugins/nunjucks/context.js'
36-
)
34+
const { context } =
35+
await import('~/src/server/plugins/nunjucks/context.js')
3736

3837
// Update config for missing manifest
3938
config.set('publicDir', tmpdir())

src/server/routes/save-and-exit.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,13 @@ export default [
197197
)
198198
}
199199

200-
if (!linkDetails || form.id !== linkDetails.form.id) {
200+
if (!linkDetails) {
201+
return h
202+
.redirect(`${ERROR_BASE_URL}/${form.slug}`)
203+
.code(StatusCodes.SEE_OTHER)
204+
}
205+
206+
if (form.id !== linkDetails.form.id) {
201207
return h
202208
.redirect(`${ERROR_BASE_URL}/${form.slug}`)
203209
.code(StatusCodes.SEE_OTHER)

src/server/routes/save-and-exit.test.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,29 @@ describe('Save-and-exit check routes', () => {
103103
)
104104
})
105105

106+
test('/route forwards correctly on magic link error - wrong form id', async () => {
107+
jest
108+
.mocked(getFormMetadataById)
109+
// @ts-expect-error - allow partial objects for tests
110+
.mockResolvedValueOnce({ slug: 'my-form-to-resume' })
111+
jest
112+
.mocked(getSaveAndExitDetails)
113+
// @ts-expect-error - allow partial objects for tests
114+
.mockResolvedValueOnce({ form: { id: 'wrong-form' } })
115+
116+
const options = {
117+
method: 'GET',
118+
url: `/resume-form/${FORM_ID}/${MAGIC_LINK_ID}`
119+
}
120+
121+
const { response } = await renderResponse(server, options)
122+
123+
expect(response.statusCode).toBe(StatusCodes.SEE_OTHER)
124+
expect(response.headers.location).toBe(
125+
'/resume-form-error/my-form-to-resume'
126+
)
127+
})
128+
106129
test('/route forwards correctly on magic link error 2', async () => {
107130
jest
108131
.mocked(getFormMetadataById)

test/fixtures/form.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export const metadata = {
3434
organisation: 'Defra',
3535
teamName: 'Defra Forms',
3636
teamEmail: 'defraforms@defra.gov.uk',
37+
notificationEmail: 'enrique.chase@defra.gov.uk',
3738
createdAt: now,
3839
createdBy: author,
3940
updatedAt: now,
@@ -77,8 +78,7 @@ export const definition = {
7778
}
7879
],
7980
conditions: [],
80-
lists: [],
81-
outputEmail: 'enrique.chase@defra.gov.uk'
81+
lists: []
8282
}
8383

8484
export const componentId = '1491981d-99cd-485e-ab4a-f88275edeadc'
@@ -121,8 +121,7 @@ export const definitionWithComponentId = {
121121
}
122122
],
123123
conditions: [],
124-
lists: [],
125-
outputEmail: 'enrique.chase@defra.gov.uk'
124+
lists: []
126125
}
127126

128127
/**

test/form/confirmation-email.test.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { getCookie, getCookieHeader } from '~/test/utils/get-cookie.js'
1414

1515
jest.mock('~/src/server/services/formsService.js')
1616
jest.mock('~/src/server/messaging/publish.js')
17+
jest.mock('~/src/server/messaging/formAdapterEventPublisher.ts')
1718
jest.mock('@defra/forms-engine-plugin/services/formSubmissionService.js')
1819

1920
const basePath = `${FORM_PREFIX}/confirmation-email`
@@ -224,7 +225,19 @@ describe('Confirmation email', () => {
224225
)
225226
})
226227

227-
it('should render the page heading with email notification warning', () => {
228+
it('should render the page heading with email notification warning', async () => {
229+
// Mock metadata without notificationEmail to trigger the warning
230+
const metadataWithoutEmail = {
231+
...fixtures.form.metadata,
232+
notificationEmail: undefined
233+
}
234+
jest.mocked(getFormMetadata).mockResolvedValueOnce(metadataWithoutEmail)
235+
236+
const { container } = await renderResponse(server, {
237+
url: `${basePath}/summary`,
238+
headers
239+
})
240+
228241
const $heading = container.getByRole('heading', {
229242
name: 'Summary',
230243
level: 1

test/form/definitions/basic.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,7 @@ export default /** @satisfies {FormDefinition} */ ({
100100
})
101101
]
102102
})
103-
],
104-
outputEmail: 'enrique.chase@defra.gov.uk'
103+
]
105104
})
106105

107106
/**

test/form/definitions/confirmation-email.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ export default /** @satisfies {FormDefinition} */ ({
4040
]),
4141
sections: [],
4242
conditions: [],
43-
lists: [],
44-
outputEmail: 'enrique.chase@defra.gov.uk'
43+
lists: []
4544
})
4645

4746
/**

0 commit comments

Comments
 (0)