@defra-fish/gafl-webapp-service 1.65.0-rc.8 → 1.65.0-rc.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +4 -4
- package/src/pages/recurring-payments/cancel/confirm/__tests__/route.spec.js +11 -1
- package/src/pages/recurring-payments/cancel/confirm/cancel-rp-confirm.njk +12 -10
- package/src/pages/recurring-payments/cancel/confirm/route.js +3 -3
- package/src/routes/journey-definition.js +3 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@defra-fish/gafl-webapp-service",
|
|
3
|
-
"version": "1.65.0-rc.
|
|
3
|
+
"version": "1.65.0-rc.9",
|
|
4
4
|
"description": "The websales frontend for the GAFL service",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
"prepare": "gulp --gulpfile build/gulpfile.cjs"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@defra-fish/business-rules-lib": "1.65.0-rc.
|
|
40
|
-
"@defra-fish/connectors-lib": "1.65.0-rc.
|
|
39
|
+
"@defra-fish/business-rules-lib": "1.65.0-rc.9",
|
|
40
|
+
"@defra-fish/connectors-lib": "1.65.0-rc.9",
|
|
41
41
|
"@defra/hapi-gapi": "2.0.0",
|
|
42
42
|
"@hapi/boom": "9.1.2",
|
|
43
43
|
"@hapi/catbox-redis": "6.0.2",
|
|
@@ -79,5 +79,5 @@
|
|
|
79
79
|
"./gafl-jest-matchers.js"
|
|
80
80
|
]
|
|
81
81
|
},
|
|
82
|
-
"gitHead": "
|
|
82
|
+
"gitHead": "52a2c512cac3348e094ea6e420d76f159b767f53"
|
|
83
83
|
}
|
|
@@ -2,6 +2,7 @@ import pageRoute from '../../../../../routes/page-route.js'
|
|
|
2
2
|
import { CANCEL_RP_CONFIRM, CANCEL_RP_COMPLETE, CANCEL_RP_IDENTIFY } from '../../../../../uri.js'
|
|
3
3
|
import { addLanguageCodeToUri } from '../../../../../processors/uri-helper.js'
|
|
4
4
|
import moment from 'moment-timezone'
|
|
5
|
+
import { dateDisplayFormat } from '../../../../../processors/date-and-time-display.js'
|
|
5
6
|
|
|
6
7
|
require('../route.js')
|
|
7
8
|
|
|
@@ -17,6 +18,10 @@ jest.mock('../../../../../uri.js', () => ({
|
|
|
17
18
|
}))
|
|
18
19
|
jest.mock('../../../../../processors/uri-helper.js')
|
|
19
20
|
jest.mock('moment-timezone')
|
|
21
|
+
jest.mock('../../../../../processors/date-and-time-display.js', () => ({
|
|
22
|
+
cacheDateFormat: Symbol('cache date format'),
|
|
23
|
+
dateDisplayFormat: Symbol('date display format')
|
|
24
|
+
}))
|
|
20
25
|
|
|
21
26
|
describe('pageRoute receives expected arguments', () => {
|
|
22
27
|
it('passes expected arguments to pageRoute', () => {
|
|
@@ -64,7 +69,7 @@ describe('getData function', () => {
|
|
|
64
69
|
})
|
|
65
70
|
|
|
66
71
|
const mockRequest = () => {
|
|
67
|
-
const getCurrentPermission = jest.fn(() => ({
|
|
72
|
+
const getCurrentPermission = jest.fn(() => ({ permission: { endDate: '2025-02-15' } }))
|
|
68
73
|
|
|
69
74
|
return {
|
|
70
75
|
locale: 'en',
|
|
@@ -109,4 +114,9 @@ describe('getData function', () => {
|
|
|
109
114
|
|
|
110
115
|
expect(data.licenceExpiry).toEqual('19th November, 2025')
|
|
111
116
|
})
|
|
117
|
+
|
|
118
|
+
it('uses expected date format', async () => {
|
|
119
|
+
await getData(mockRequest())
|
|
120
|
+
expect(moment.mock.results[0].value.format).toHaveBeenCalledWith(dateDisplayFormat)
|
|
121
|
+
})
|
|
112
122
|
})
|
|
@@ -21,21 +21,23 @@
|
|
|
21
21
|
}
|
|
22
22
|
}) %}
|
|
23
23
|
|
|
24
|
-
<p class="govuk-body-m">{{ mssgs.rp_cancel_confirm_body }}</p>
|
|
24
|
+
<p class="govuk-body-m">{{ mssgs.rp_cancel_confirm_body }}{{ data.licenceExpiry }}</p>
|
|
25
25
|
|
|
26
26
|
<div class="govuk-grid-row">
|
|
27
27
|
<div class="govuk-grid-column-two-thirds">
|
|
28
28
|
<form method="post" class="govuk-!-margin-bottom-6">
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
29
|
+
<div class="govuk-button-group">
|
|
30
|
+
{{ govukButton({
|
|
31
|
+
attributes: { id: 'continue' },
|
|
32
|
+
preventDoubleClick: true,
|
|
33
|
+
name: "continue",
|
|
34
|
+
text: mssgs.rp_cancel_confirm_accept,
|
|
35
|
+
classes: "govuk-!-margin-top-1"
|
|
36
|
+
}) }}
|
|
37
|
+
{{ csrf() }}
|
|
38
|
+
<p class="govuk-body no-print"><a class="govuk-link" href="{{ data.uri.cancelRpIdentify }}">{{ mssgs.rp_cancel_confirm_reject }}</a></p>
|
|
39
|
+
</div>
|
|
37
40
|
</form>
|
|
38
|
-
<p class="govuk-body no-print"><a class="govuk-link" href="{{ data.uri.cancelRpIdentify }}">{{ mssgs.rp_cancel_confirm_reject }}</a></p>
|
|
39
41
|
</div>
|
|
40
42
|
</div>
|
|
41
43
|
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import pageRoute from '../../../../routes/page-route.js'
|
|
2
2
|
import { CANCEL_RP_COMPLETE, CANCEL_RP_CONFIRM, CANCEL_RP_IDENTIFY } from '../../../../uri.js'
|
|
3
3
|
import { addLanguageCodeToUri } from '../../../../processors/uri-helper.js'
|
|
4
|
-
import { cacheDateFormat } from '../../../../processors/date-and-time-display.js'
|
|
4
|
+
import { cacheDateFormat, dateDisplayFormat } from '../../../../processors/date-and-time-display.js'
|
|
5
5
|
import moment from 'moment-timezone'
|
|
6
6
|
|
|
7
7
|
const getData = async request => {
|
|
8
|
-
const permission = await request.cache().helpers.transaction.getCurrentPermission()
|
|
8
|
+
const { permission } = await request.cache().helpers.transaction.getCurrentPermission()
|
|
9
9
|
|
|
10
10
|
return {
|
|
11
|
-
licenceExpiry: moment(permission.
|
|
11
|
+
licenceExpiry: moment(permission.endDate, cacheDateFormat, request.locale).format(dateDisplayFormat),
|
|
12
12
|
uri: {
|
|
13
13
|
cancelRpIdentify: addLanguageCodeToUri(request, CANCEL_RP_IDENTIFY.uri)
|
|
14
14
|
}
|