@defra-fish/gafl-webapp-service 1.23.0 → 1.24.0-rc.10
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/constants.js +6 -0
- package/src/handlers/authentication-handler.js +5 -9
- package/src/locales/cy.json +79 -76
- package/src/locales/en.json +8 -5
- package/src/pages/contact/digital-licence/check-confirmation-contact/__tests__/__snapshots__/check-confirmation-contact.spec.js.snap +2 -2
- package/src/pages/contact/digital-licence/check-confirmation-contact/__tests__/check-confirmation-contact.spec.js +45 -1
- package/src/pages/contact/digital-licence/check-confirmation-contact/check-confirmation-contact.njk +1 -4
- package/src/pages/contact/digital-licence/check-confirmation-contact/route.js +6 -2
- package/src/pages/guidance/accessibility-statement.njk +2 -2
- package/src/pages/licence-details/licence-length/__tests__/route.spec.js +32 -2
- package/src/pages/licence-details/licence-length/licence-length.njk +2 -2
- package/src/pages/licence-details/licence-length/route.js +1 -1
- package/src/pages/licence-details/licence-type/licence-type.njk +2 -2
- package/src/pages/macros/pricing-summary.njk +2 -6
- package/src/pages/order-complete/licence-details/__tests__/licence-details.spec.js +7 -1
- package/src/pages/order-complete/licence-details/__tests__/route.spec.js +89 -0
- package/src/pages/order-complete/licence-details/route.js +1 -1
- package/src/pages/renewals/renewal-inactive/__tests__/route.spec.js +113 -0
- package/src/pages/renewals/renewal-inactive/renewal-inactive.njk +30 -19
- package/src/pages/renewals/renewal-inactive/route.js +40 -5
- package/src/pages/summary/licence-summary/__tests__/route.spec.js +43 -1
- package/src/pages/summary/licence-summary/route.js +1 -1
- package/src/processors/__tests__/licence-type-display.spec.js +103 -0
- package/src/processors/__tests__/payment.spec.js +43 -0
- package/src/processors/__tests__/uri-helper.spec.js +27 -0
- package/src/processors/licence-type-display.js +15 -11
- package/src/processors/payment.js +4 -1
- package/src/processors/uri-helper.js +2 -1
- package/src/services/payment/__test__/govuk-pay-service.spec.js +55 -4
- package/src/pages/macros/licence-type-summary.njk +0 -19
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@defra-fish/gafl-webapp-service",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.24.0-rc.10",
|
|
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.
|
|
40
|
-
"@defra-fish/connectors-lib": "1.
|
|
39
|
+
"@defra-fish/business-rules-lib": "1.24.0-rc.10",
|
|
40
|
+
"@defra-fish/connectors-lib": "1.24.0-rc.10",
|
|
41
41
|
"@defra/hapi-gapi": "^1.1.0",
|
|
42
42
|
"@hapi/boom": "^9.1.2",
|
|
43
43
|
"@hapi/catbox-redis": "^6.0.2",
|
|
@@ -76,5 +76,5 @@
|
|
|
76
76
|
"gulp-sourcemaps": "^3.0.0",
|
|
77
77
|
"node-sass": "^6.0.1"
|
|
78
78
|
},
|
|
79
|
-
"gitHead": "
|
|
79
|
+
"gitHead": "5ecb6077c8bf4a27f4c44510750bd57141e54c30"
|
|
80
80
|
}
|
package/src/constants.js
CHANGED
|
@@ -56,6 +56,12 @@ export const ShowDigitalLicencePages = {
|
|
|
56
56
|
NO: 'show-digital-licence-no'
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
+
export const RENEWAL_ERROR_REASON = {
|
|
60
|
+
NOT_DUE: 'not-due',
|
|
61
|
+
EXPIRED: 'expired',
|
|
62
|
+
NOT_ANNUAL: 'not-annual'
|
|
63
|
+
}
|
|
64
|
+
|
|
59
65
|
// If the user has seen the summary page these are set in the status
|
|
60
66
|
export const CONTACT_SUMMARY_SEEN = 'contact-summary'
|
|
61
67
|
export const LICENCE_SUMMARY_SEEN = 'licence-summary'
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { setUpCacheFromAuthenticationResult, setUpPayloads } from '../processors/renewals-write-cache.js'
|
|
2
2
|
import { IDENTIFY, CONTROLLER, RENEWAL_INACTIVE } from '../uri.js'
|
|
3
|
+
import { RENEWAL_ERROR_REASON } from '../constants.js'
|
|
3
4
|
import { validation, RENEW_BEFORE_DAYS, RENEW_AFTER_DAYS, SERVICE_LOCAL_TIME } from '@defra-fish/business-rules-lib'
|
|
4
5
|
import Joi from 'joi'
|
|
5
6
|
import { salesApi } from '@defra-fish/connectors-lib'
|
|
@@ -47,21 +48,16 @@ export default async (request, h) => {
|
|
|
47
48
|
return h.redirect(IDENTIFY.uri)
|
|
48
49
|
} else {
|
|
49
50
|
// Test for 12 month licence
|
|
50
|
-
const daysDiff = moment(authenticationResult.permission.endDate).diff(
|
|
51
|
-
moment()
|
|
52
|
-
.tz(SERVICE_LOCAL_TIME)
|
|
53
|
-
.startOf('day'),
|
|
54
|
-
'days'
|
|
55
|
-
)
|
|
51
|
+
const daysDiff = moment(authenticationResult.permission.endDate).diff(moment().tz(SERVICE_LOCAL_TIME).startOf('day'), 'days')
|
|
56
52
|
if (
|
|
57
53
|
authenticationResult.permission.permit.durationDesignator.description === 'M' &&
|
|
58
54
|
authenticationResult.permission.permit.durationMagnitude === 12
|
|
59
55
|
) {
|
|
60
56
|
// Test for active renewal
|
|
61
57
|
if (daysDiff > RENEW_BEFORE_DAYS) {
|
|
62
|
-
return linkInactive(
|
|
58
|
+
return linkInactive(RENEWAL_ERROR_REASON.NOT_DUE)
|
|
63
59
|
} else if (daysDiff < -RENEW_AFTER_DAYS) {
|
|
64
|
-
return linkInactive(
|
|
60
|
+
return linkInactive(RENEWAL_ERROR_REASON.EXPIRED)
|
|
65
61
|
} else {
|
|
66
62
|
await setUpCacheFromAuthenticationResult(request, authenticationResult)
|
|
67
63
|
await setUpPayloads(request)
|
|
@@ -69,7 +65,7 @@ export default async (request, h) => {
|
|
|
69
65
|
return h.redirect(CONTROLLER.uri)
|
|
70
66
|
}
|
|
71
67
|
} else {
|
|
72
|
-
return linkInactive(
|
|
68
|
+
return linkInactive(RENEWAL_ERROR_REASON.NOT_ANNUAL)
|
|
73
69
|
}
|
|
74
70
|
}
|
|
75
71
|
}
|
package/src/locales/cy.json
CHANGED
|
@@ -1,58 +1,60 @@
|
|
|
1
1
|
{
|
|
2
2
|
"access_statement_ability_net_link": "AbilityNet",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
3
|
+
"access_statement_ability_net_1": "Mae gan ",
|
|
4
|
+
"access_statement_ability_net_2": " gyngor ar sicrhau bod eich dyfais yn hawdd ei defnyddio os oes gennych anabledd.",
|
|
5
|
+
"access_statement_body": "Cynhelir y gwasanaeth hwn gan Asiantaeth yr Amgylchedd. Rydym am weld cymaint o bobl â phosib yn defnyddio’r wefan hon. Er enghraifft, mae hynny’n golygu y dylech fod yn gallu gwneud y canlynol:",
|
|
6
|
+
"access_statement_bulletpoint_1": "newid lliwiau, lefelau cyferbynnedd a ffontiau",
|
|
7
|
+
"access_statement_bulletpoint_2": "chwyddo mewn hyd at 200% heb i’r testun fynd oddi ar y sgrin",
|
|
8
|
+
"access_statement_bulletpoint_3": "gwe-lywio’r rhan fwyaf o’r wefan gan ddefnyddio bysellfwrdd yn unig",
|
|
9
|
+
"access_statement_bulletpoint_4": "gwe-lywio’r rhan fwyaf o’r wefan gan ddefnyddio meddalwedd adnabod llais",
|
|
10
|
+
"access_statement_bulletpoint_5": "gwrando ar y rhan fwyaf o’r wefan gan ddefnyddio darllenydd sgrin (gan gynnwys y fersiynau diweddaraf o JAWS, NVDA a VoiceOver)",
|
|
11
|
+
"access_statement_burden_title": "Baich anghymesurol",
|
|
12
|
+
"access_statement_compliance_body_1": "Mae’r wefan hon yn cydymffurfio’n rhannol â safon AA ",
|
|
13
|
+
"access_statement_compliance_body_2": " , yn sgil yr achosion o ddiffyg cydymffurfio sydd wedi’u rhestru isod.",
|
|
14
|
+
"access_statement_compliance_body_link": "fersiwn 2.1 o Ganllawiau Hygyrchedd Cynnwys Gwefannau (WCAG)",
|
|
15
|
+
"access_statement_compliance_heading": "Statws cydymffurfio",
|
|
16
|
+
"access_statement_enforcement_subheading": "Gweithdrefn gorfodi",
|
|
17
|
+
"access_statement_enforcement_body": "Mae’r Comisiwn Cydraddoldeb a Hawliau Dynol yn gyfrifol am orfodi Rheoliadau Hygyrchedd Cyrff Sector Cyhoeddus (Gwefannau ac Apiau Symudol (Rhif 2) 2018 (y ‘rheoliadau hygyrchedd’). Os ydych yn anhapus â’r ffordd rydym yn ymateb i’ch cwyn, cysylltwch â’r ",
|
|
18
|
+
"access_statement_enforcement_link": "Gwasanaeth Cynghori a Chefnogi Cydraddoldeb (EASS)",
|
|
19
|
+
"access_statement_how_subheading": "Pa mor hygyrch yw’r wefan hon?",
|
|
19
20
|
"access_statement_feedback_info_bulletpoint_1_link": "enquiries@environment-agency.gov.uk",
|
|
20
|
-
"access_statement_feedback_info_bulletpoint_1": "
|
|
21
|
-
"access_statement_feedback_info_bulletpoint_2_call": "
|
|
21
|
+
"access_statement_feedback_info_bulletpoint_1": "e-bostio: ",
|
|
22
|
+
"access_statement_feedback_info_bulletpoint_2_call": "ffonio ",
|
|
22
23
|
"access_statement_feedback_info_bulletpoint_2_link": "03708 506 506",
|
|
23
|
-
"access_statement_feedback_info_bulletpoint_2_times": " (
|
|
24
|
-
"access_statement_feedback_info": "
|
|
25
|
-
"access_statement_feedback_subheading": "
|
|
26
|
-
"access_statement_heading": "
|
|
27
|
-
"access_statement_how_info_bulletpoint_1": "
|
|
28
|
-
"access_statement_how_info_bulletpoint_2": "
|
|
29
|
-
"access_statement_how_info": "
|
|
30
|
-
"access_statement_made_simple": "
|
|
31
|
-
"access_statement_nonaccess_body": "
|
|
32
|
-
"access_statement_nonaccess_heading": "
|
|
33
|
-
"access_statement_noncompliance_body_1": "
|
|
34
|
-
"access_statement_noncompliance_body_2": ".
|
|
35
|
-
"access_statement_noncompliance_body_link": "
|
|
36
|
-
"access_statement_noncompliance_heading": "
|
|
37
|
-
"access_statement_none": "
|
|
38
|
-
"access_statement_not_in_scope_title": "
|
|
39
|
-
"access_statement_prep_body_1": "
|
|
40
|
-
"access_statement_prep_body_2": "
|
|
41
|
-
"access_statement_prep_body_3": "
|
|
42
|
-
"access_statement_prep_body_4": "
|
|
43
|
-
"access_statement_prep_bulletpoint_1": "12
|
|
44
|
-
"access_statement_prep_bulletpoint_2": "12
|
|
45
|
-
"access_statement_prep_bulletpoint_3": "
|
|
46
|
-
"access_statement_prep_heading": "
|
|
47
|
-
"access_statement_reporting_info": "
|
|
48
|
-
"access_statement_reporting_subheading": "
|
|
49
|
-
"access_statement_tech_body": "
|
|
50
|
-
"access_statement_tech_heading": "
|
|
24
|
+
"access_statement_feedback_info_bulletpoint_2_times": " (dydd Llun i ddydd Gwener, 8am tan 6pm)",
|
|
25
|
+
"access_statement_feedback_info": "Os oes arnoch angen gwybodaeth ar y wefan hon mewn fformat arall fel PDF hygyrch, print bras, fersiwn hawdd ei deall, recordiad sain neu Braille, cysylltwch drwy un o’r dulliau canlynol:",
|
|
26
|
+
"access_statement_feedback_subheading": "Adborth a manylion cyswllt",
|
|
27
|
+
"access_statement_heading": "Datganiad hygyrchedd ar gyfer cyflwyno cais am drwydded bysgota â gwialen",
|
|
28
|
+
"access_statement_how_info_bulletpoint_1": "Ar dudalen dyddiad dechrau’r drwydded, nid yw dewiswr dyddiad y calendr yn hygyrch i’r rheiny sy’n defnyddio bysellfyrddau neu ddarllenwyr sgrin. Gall defnyddwyr ag anghenion hygyrchedd nodi’r dyddiad hwn gan ddefnyddio’r meysydd diwrnod, mis a blwyddyn safonol.",
|
|
29
|
+
"access_statement_how_info_bulletpoint_2": "Mae’r dyddiadau calendr hanesyddol yn rhy isel o ran cyferbyniad",
|
|
30
|
+
"access_statement_how_info": "Gall yr holl ddefnyddwyr ag anghenion mynediad gwblhau’r broses o brynu trwydded gwialen bysgota trwy ddefnyddio’r gwasanaeth hwn. Fodd bynnag, rydym yn gwybod nad yw rhai rhannau o’r wefan hon yn gwbl hygyrch:",
|
|
31
|
+
"access_statement_made_simple": "Rydym hefyd wedi sicrhau bod y testun ar y wefan mor syml â phosib i’w ddeall.",
|
|
32
|
+
"access_statement_nonaccess_body": "Nid yw’r cynnwys a restrir isod yn hygyrch am y rhesymau canlynol.",
|
|
33
|
+
"access_statement_nonaccess_heading": "Cynnwys nad yw’n hygyrch",
|
|
34
|
+
"access_statement_noncompliance_body_1": "Nid yw defnyddwyr bob tro’n gwybod pan fo cynnwys amodol sy’n gysylltiedig â botwm radio neu flwch gwirio wedi’i ehangu neu ei gwympo. Mae hyn yn methu ",
|
|
35
|
+
"access_statement_noncompliance_body_2": ". Byddwn yn adolygu hyn erbyn diwedd mis Ionawr 2022. ",
|
|
36
|
+
"access_statement_noncompliance_body_link": "maen prawf llwyddiant 4.1.2: Enw, Rôl, Gwerth WCAG 2.1",
|
|
37
|
+
"access_statement_noncompliance_heading": "Diffyg cydymffurfio â’r rheoliadau hygyrchedd",
|
|
38
|
+
"access_statement_none": "Dim.",
|
|
39
|
+
"access_statement_not_in_scope_title": "Cynnwys nad o fewn cwmpas y rheoliadau hygyrchedd",
|
|
40
|
+
"access_statement_prep_body_1": "Paratowyd y datganiad hwn ar 23 Medi 2020. Fe’i hadolygwyd ddiwethaf ar 13 Hydref 2021.",
|
|
41
|
+
"access_statement_prep_body_2": "Archwiliwyd y gwasanaeth am hygyrchedd gan y Ganolfan Hygyrchedd Digidol ar 13 Ebrill 2021 a chan dîm cydymffurfedd gwe Adran yr Amgylchedd Bwyd a Materion Gwledig ar 22 Ebrill 2021.",
|
|
42
|
+
"access_statement_prep_body_3": "Gwnaethom brofi’r camau mwyaf cyffredin ar gyfer cyflwyno cais am y mathau hyn o drwydded:",
|
|
43
|
+
"access_statement_prep_body_4": "Caiff yr elfennau o ddiffyg cydymffurfio eu cynnwys mewn gwaith profi a thrwsio parhaus.",
|
|
44
|
+
"access_statement_prep_bulletpoint_1": "12 mis: pysgod bras a brithyllod",
|
|
45
|
+
"access_statement_prep_bulletpoint_2": "12 mis: eogiaid a brithyllod y môr",
|
|
46
|
+
"access_statement_prep_bulletpoint_3": "iau",
|
|
47
|
+
"access_statement_prep_heading": "Llunio’r datganiad hygyrchedd hwn",
|
|
48
|
+
"access_statement_reporting_info": "Rydym yn awyddus bob amser i wella hygyrchedd y wefan hon. Os ydych yn cael unrhyw broblemau nad ydynt wedi’u rhestru ar y dudalen hon neu os nad ydych yn meddwl ein bod yn bodloni gofynion hygyrchedd, cysylltwch drwy un o’r dulliau canlynol:",
|
|
49
|
+
"access_statement_reporting_subheading": "Adrodd am broblemau hygyrchedd gyda’r wefan hon",
|
|
50
|
+
"access_statement_tech_body": "Mae Asiantaeth yr Amgylchedd yn ymrwymedig i sicrhau bod ei gwefan yn hygyrch, yn unol â Rheoliadau Hygyrchedd Cyrff Sector Cyhoeddus (Gwefannau ac Apiau Symudol) (Rhif 2) 2018.",
|
|
51
|
+
"access_statement_tech_heading": "Gwybodaeth dechnegol am hygyrchedd y wefan hon",
|
|
51
52
|
"access_statement_title": "Accessibility statement - GOV.UK",
|
|
52
|
-
"access_statement_visit_info_link": "
|
|
53
|
-
"access_statement_visit_info_text_serivce": "
|
|
54
|
-
"
|
|
55
|
-
"
|
|
53
|
+
"access_statement_visit_info_link": "mynediad ac oriau agor swyddfeydd",
|
|
54
|
+
"access_statement_visit_info_text_serivce": "Nid ydym yn darparu gwasanaeth cyfnewid testun i bobl sy’n fyddar, sydd â nam ar eu clyw, neu sydd â nam lleferydd ar hyn o bryd.",
|
|
55
|
+
"access_statement_visit_info_1": "Gweler ",
|
|
56
|
+
"access_statement_visit_info_2": " Asiantaeth yr Amgylchedd.",
|
|
57
|
+
"access_statement_visit": "Os ydych yn ymweld â’n swyddfeydd ac mae angen cymorth arnoch neu ddehonglydd Iaith Arwyddion Prydain, dylech gysylltu â ni cyn eich ymweliad.",
|
|
56
58
|
"account_disabled_body_1": "You were successfully signed in but your account is not enabled in Microsoft Dynamics.",
|
|
57
59
|
"account_disabled_title": "Account not enabled",
|
|
58
60
|
"address_entry_content_and_postcode": "and postcode",
|
|
@@ -123,8 +125,8 @@
|
|
|
123
125
|
"client_error_title_unauth": "Unauthorized",
|
|
124
126
|
"concession_applied": "Consesiwn wedi’i gynnwys",
|
|
125
127
|
"contact_summary_title": "Check the contact details",
|
|
126
|
-
"contact_us_body": "
|
|
127
|
-
"contact_us_heading": "
|
|
128
|
+
"contact_us_body": "Gallwch gysylltu â ni drwy’r dulliau canlynol:",
|
|
129
|
+
"contact_us_heading": "Cysylltu â ni",
|
|
128
130
|
"continue": "Parhau",
|
|
129
131
|
"cookie_banner_close_ex": "cookie banner",
|
|
130
132
|
"cookie_banner_close": "Close",
|
|
@@ -242,17 +244,17 @@
|
|
|
242
244
|
"identify_subheading_problem": "Problem with the licence details?",
|
|
243
245
|
"identify_title": "Renew your rod fishing licence?",
|
|
244
246
|
"important_info_contact_error_choose": "Dewiswch sut y dylem gysylltu â deiliad y drwydded",
|
|
245
|
-
"important_info_contact_error_email": "Rhowch gyfeiriad e-bost yn y fformat
|
|
247
|
+
"important_info_contact_error_email": "Rhowch gyfeiriad e-bost yn y fformat cywir",
|
|
246
248
|
"important_info_contact_error_mobile": "Nodwch rif ffôn symudol yn y DU",
|
|
247
249
|
"important_info_contact_input_email_hint": "Er enghraifft enw@enghraifft.com",
|
|
248
|
-
"important_info_contact_input_email": "
|
|
250
|
+
"important_info_contact_input_email": "Cyfeiriad e-bost",
|
|
249
251
|
"important_info_contact_input_mobile_hint": "Er enghraifft 07700 900 900",
|
|
250
252
|
"important_info_contact_input_mobile_note": "Mobile phone number",
|
|
251
|
-
"important_info_contact_input_mobile": "Rhif ffôn symudol y DU",
|
|
253
|
+
"important_info_contact_input_mobile": "Rhif ffôn symudol yn y DU",
|
|
252
254
|
"important_info_contact_item_email": "E-bost",
|
|
253
255
|
"important_info_contact_item_txt": "Neges destun",
|
|
254
256
|
"important_info_contact_licence_needed": "The rod licence holder will need to confirm the licence number if asked by an enforcement officer.",
|
|
255
|
-
"important_info_contact_none_msg": "
|
|
257
|
+
"important_info_contact_none_msg": "Byddwn yn dangos rhif y drwydded i chi ar ôl cadarnhau.",
|
|
256
258
|
"important_info_contact_note_tip": "Gwnewch nodyn o rif y drwydded",
|
|
257
259
|
"important_info_contact_post_confirm_8d": "We don’t provide physical cards for 1 or 8 day licences.",
|
|
258
260
|
"important_info_contact_post_confirm_jr": "We don’t provide physical cards for junior licences.",
|
|
@@ -262,15 +264,15 @@
|
|
|
262
264
|
"important_info_contact_post": "Post",
|
|
263
265
|
"important_info_contact_title_other": "Sut y dylem gysylltu â deiliad y drwydded ynghylch nodiadau atgoffa a newidiadau pwysig?",
|
|
264
266
|
"important_info_contact_title_you": "Sut dylen ni gysylltu â chi am nodiadau atgoffa a newidiadau pwysig?",
|
|
265
|
-
"licence_confirm_method_error_choose": "Dewiswch sut dylen
|
|
266
|
-
"licence_confirm_method_how_body_item": "
|
|
267
|
-
"licence_confirm_method_how_body_text": "
|
|
267
|
+
"licence_confirm_method_error_choose": "Dewiswch sut dylen anfon y drwydded",
|
|
268
|
+
"licence_confirm_method_how_body_item": "Byddaf yn gwneud nodyn o rif y drwydded",
|
|
269
|
+
"licence_confirm_method_how_body_text": "Dyma lle y byddwn yn anfon cadarnhad o’ch trwydded bysgota",
|
|
268
270
|
"licence_confirm_method_how_title_other": "How do they want their fishing licence confirmation?",
|
|
269
|
-
"licence_confirm_method_how_title_you": "
|
|
271
|
+
"licence_confirm_method_how_title_you": "Sut hoffech chi dderbyn cadarnhad o'ch trwydded bysgota?",
|
|
270
272
|
"licence_confirm_method_where_body_hint_other": "Licence information will be sent by email or text message only. We will not send a licence card.",
|
|
271
273
|
"licence_confirm_method_where_body_hint_you": "Byddwch yn derbyn gwybodaeth am eich trwydded drwy e-bost neu neges destun yn unig. Ni fyddwch yn derbyn cerdyn trwydded.",
|
|
272
274
|
"licence_confirm_method_where_body_text": "Dyma ble byddwn yn anfon y drwydded ar ôl derbyn y taliad.",
|
|
273
|
-
"licence_confirm_method_where_title_other": "
|
|
275
|
+
"licence_confirm_method_where_title_other": "I ble y dylen ni anfon y drwydded bysgota?",
|
|
274
276
|
"licence_confirm_method_where_title_you": "I ble y dylen ni anfon eich trwydded bysgota?",
|
|
275
277
|
"licence_date_picker": "Click to open date picker",
|
|
276
278
|
"licence_details_body": "This is proof of the fishing licence. You might find it useful to take a screenshot or print out this page.",
|
|
@@ -302,7 +304,7 @@
|
|
|
302
304
|
"licence_length_eight_day": "Mae trwyddedau wyth niwrnod yn ddilys am wyth niwrnod yn olynol o’r amser cychwyn a ddewiswch",
|
|
303
305
|
"licence_length_error_choose": "Dewiswch hyd y drwydded",
|
|
304
306
|
"licence_length_one_day": "Mae trwyddedau un diwrnod yn ddilys am 24 awr o’r amser cychwyn a ddewiswch",
|
|
305
|
-
"licence_length_title_other": "
|
|
307
|
+
"licence_length_title_other": "Am ba hyd y maent am gael y drwydded?",
|
|
306
308
|
"licence_length_title_you": "Am ba hyd yr hoffech chi gael y drwydded?",
|
|
307
309
|
"licence_num": "Licence number",
|
|
308
310
|
"licence_start_days": " diwrnod nesaf",
|
|
@@ -358,7 +360,7 @@
|
|
|
358
360
|
"licence_summary_type": "Type",
|
|
359
361
|
"licence_type_12m": "12 mis",
|
|
360
362
|
"licence_type_1d": "1 diwrnod",
|
|
361
|
-
"licence_type_8d": "8
|
|
363
|
+
"licence_type_8d": "8 niwrnod",
|
|
362
364
|
"licence_type_attended_rods_note": "Mae’r gwialenni i’w defnyddio gan ddeiliad y drwydded yn unig ac mae’n rhaid eu goruchwylio ar bob adeg.",
|
|
363
365
|
"licence_type_byelaws": "is-ddeddfau pysgota lleol (yn agor mewn tab newydd)",
|
|
364
366
|
"licence_type_error_choose": "Dewiswch un o’r mathau o drwyddedau pysgota",
|
|
@@ -430,7 +432,7 @@
|
|
|
430
432
|
"our_address_3": "Deanery Road",
|
|
431
433
|
"our_address_4": "Bristol",
|
|
432
434
|
"our_address_5": "BS1 5AH",
|
|
433
|
-
"over_65": "Dros 65
|
|
435
|
+
"over_65": "Dros 65",
|
|
434
436
|
"payment_cancelled_title": "Your payment has been cancelled",
|
|
435
437
|
"payment_failed_expired": "The payment was not completed within 90 minutes of being created",
|
|
436
438
|
"payment_failed_not_taken": "No money has been taken from your account.",
|
|
@@ -496,26 +498,27 @@
|
|
|
496
498
|
"privacy_where_stored_body_2": "The organisations we share personal data with process and store data in the UK. Our processor may also store this data outside the UK in Switzerland.",
|
|
497
499
|
"privacy_where_stored_body_3": "We do not store payment details.",
|
|
498
500
|
"purpose": "Purpose",
|
|
499
|
-
"refund_bulletpoint_1": "
|
|
500
|
-
"refund_bulletpoint_2_1": "
|
|
501
|
-
"refund_bulletpoint_2_2": "
|
|
502
|
-
"refund_bulletpoint_2_link": "
|
|
503
|
-
"refund_bulletpoint_3": "
|
|
504
|
-
"refund_bulletpoint_4": "
|
|
505
|
-
"refund_bulletpoint_5": "
|
|
506
|
-
"refund_bulletpoint_6": "
|
|
507
|
-
"refund_bulletpoint_7": "
|
|
508
|
-
"refund_heading": "
|
|
501
|
+
"refund_bulletpoint_1": "Gall Asiantaeth yr Amgylchedd ad-dalu cost trwydded i’r prynwr yn unig. Dylai’r holl geisiadau am ad-daliad gael eu cyfeirio i Asiantaeth yr Amgylchedd, ac eithrio mewn achosion lle mae’r drwydded wedi cael ei phrynu drwy drydydd parti (ac eithrio Swyddfa’r Post), pan ddylai ceisiadau am ad-daliadau gael eu cyfeirio iddyn nhw. Ffoniwch Asiantaeth yr Amgylchedd ar 03708 506506.",
|
|
502
|
+
"refund_bulletpoint_2_1": "Ni fydd Asiantaeth yr Amgylchedd yn codi ffi pan fyddwch yn prynu trwydded drwy ein ",
|
|
503
|
+
"refund_bulletpoint_2_2": " neu Swyddfa’r Post. Nid ydym yn argymell prynu eich trwydded drwy wefannau trydydd parti, efallai y byddant yn codi ffi ar ben cost y drwydded. Os gwnaethoch brynu eich trwydded drwy drydydd parti, cysylltwch ag ef yn uniongyrchol i ofyn iddo ad-dalu cost y drwydded a/neu’r ffi. Ni fydd Asiantaeth yr Amgylchedd yn ad-dalu deiliaid trwyddedau ar gyfer trwyddedau a brynwyd drwy drydydd partïon.",
|
|
504
|
+
"refund_bulletpoint_2_link": "gwefan",
|
|
505
|
+
"refund_bulletpoint_3": "Os ydych yn prynu trwydded ar gam neu’n prynu’r math anghywir o drwydded, ar eich cyfer chi neu rywun arall, gall y prynwr ofyn am ad-daliad o fewn 14 diwrnod o’r dyddiad prynu gwreiddiol.",
|
|
506
|
+
"refund_bulletpoint_4": "Pan fydd gwall wedi digwydd y gellir ei briodoli i Asiantaeth yr Amgylchedd neu Swyddfa’r Post, cysylltwch â ni’n uniongyrchol o fewn 14 diwrnod o’r dyddiad prynu gwreiddiol i ofyn am ad-daliad llawn. Ffoniwch Asiantaeth yr Amgylchedd ar 03708 506506.",
|
|
507
|
+
"refund_bulletpoint_5": "Ni chynigir ad-daliadau ar gyfer trwyddedau 1 diwrnod nac 8 niwrnod. Os ydych yn uwchraddio i drwydded 12 mis o fewn 14 diwrnod o ddyddiad dod i ben y drwydded tymor byr, byddwn yn ad-dalu cost y drwydded tymor byr ar ôl i chi brynu’r drwydded 12 mis.",
|
|
508
|
+
"refund_bulletpoint_6": "Gallwch ofyn am ad-daliad os ydych yn uwchraddio trwydded 2 wialen i drwydded 3 gwialen o fewn 14 diwrnod o’r dyddiad prynu gwreiddiol. Byddwn yn ad-dalu cost y drwydded 2 wialen ar ôl i chi brynu’r drwydded 3 gwialen.",
|
|
509
|
+
"refund_bulletpoint_7": "Gallwch ofyn am ad-daliad os ydych yn uwchraddio trwydded pysgod bras i drwydded eogiaid a brithyllod y môr o fewn 14 diwrnod o’r dyddiad prynu gwreiddiol. Byddwn yn ad-dalu cost y drwydded pysgod bras ar ôl i chi brynu’r drwydded eogiaid a brithyllod y môr.",
|
|
510
|
+
"refund_heading": "Polisi ad-dalu",
|
|
509
511
|
"refund_title": "Refund policy - GOV.UK",
|
|
510
512
|
"renewal_inactive_has_expired_1": " has expired on ",
|
|
511
513
|
"renewal_inactive_has_expired_2": " and can no longer be renewed",
|
|
512
|
-
"renewal_inactive_not_annual_1": " is not a 12 month licence and cannot be renewed",
|
|
514
|
+
"renewal_inactive_not_annual_1": " is not a 12 month licence and cannot be renewed.",
|
|
513
515
|
"renewal_inactive_not_due_1": "The licence ending in ",
|
|
514
516
|
"renewal_inactive_not_due_2": " does not expire until ",
|
|
515
|
-
"renewal_inactive_not_due_3": "Click continue to buy a another licence",
|
|
516
517
|
"renewal_inactive_title_1": "You are renewing this licence too early",
|
|
517
518
|
"renewal_inactive_title_2": "The licence renewal has expired",
|
|
518
519
|
"renewal_inactive_title_3": "You cannot renew an 8 day or 1 day licence",
|
|
520
|
+
"renewal_inactive_title_4": "You can ",
|
|
521
|
+
"renewal_inactive_title_link": "buy a new licence.",
|
|
519
522
|
"renewal_start_date_error_format": "Not a valid date. Enter the date you want the licence to start on and include a day, month and year",
|
|
520
523
|
"renewal_start_date_error_hint_1": "Enter a date between ",
|
|
521
524
|
"renewal_start_date_error_max_1": "Your new licence must start within ",
|
package/src/locales/en.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"access_statement_ability_net_link": "AbilityNet",
|
|
3
|
-
"
|
|
3
|
+
"access_statement_ability_net_1": " has advice on making your device easier to use if you have a disability.",
|
|
4
|
+
"access_statement_ability_net_2": " has advice on making your device easier to use if you have a disability.",
|
|
4
5
|
"access_statement_body": "This service is run by the Environment Agency. We want as many people as possible to be able to use this website. For example, that means you should be able to:",
|
|
5
6
|
"access_statement_bulletpoint_1": "change colours, contrast levels and fonts",
|
|
6
7
|
"access_statement_bulletpoint_2": "zoom in up to 200% without the text spilling off the screen",
|
|
@@ -51,7 +52,8 @@
|
|
|
51
52
|
"access_statement_title": "Accessibility statement - GOV.UK",
|
|
52
53
|
"access_statement_visit_info_link": "office access and opening times",
|
|
53
54
|
"access_statement_visit_info_text_serivce": "We do not currently have a text relay service for people who are deaf, hearing impaired or have a speech impediment.",
|
|
54
|
-
"
|
|
55
|
+
"access_statement_visit_info_1": "See the Environment Agency’s ",
|
|
56
|
+
"access_statement_visit_info_2": ".",
|
|
55
57
|
"access_statement_visit": "If you visit our offices and need assistance or a British Sign Language interpreter, you should contact us before you visit.",
|
|
56
58
|
"account_disabled_body_1": "You were successfully signed in but your account is not enabled in Microsoft Dynamics.",
|
|
57
59
|
"account_disabled_title": "Account not enabled",
|
|
@@ -430,7 +432,7 @@
|
|
|
430
432
|
"our_address_3": "Deanery Road",
|
|
431
433
|
"our_address_4": "Bristol",
|
|
432
434
|
"our_address_5": "BS1 5AH",
|
|
433
|
-
"over_65": "Over 65
|
|
435
|
+
"over_65": "Over 65",
|
|
434
436
|
"payment_cancelled_title": "Your payment has been cancelled",
|
|
435
437
|
"payment_failed_expired": "The payment was not completed within 90 minutes of being created",
|
|
436
438
|
"payment_failed_not_taken": "No money has been taken from your account.",
|
|
@@ -509,13 +511,14 @@
|
|
|
509
511
|
"refund_title": "Refund policy - GOV.UK",
|
|
510
512
|
"renewal_inactive_has_expired_1": " has expired on ",
|
|
511
513
|
"renewal_inactive_has_expired_2": " and can no longer be renewed",
|
|
512
|
-
"renewal_inactive_not_annual_1": " is not a 12 month licence and cannot be renewed",
|
|
514
|
+
"renewal_inactive_not_annual_1": " is not a 12 month licence and cannot be renewed.",
|
|
513
515
|
"renewal_inactive_not_due_1": "The licence ending in ",
|
|
514
516
|
"renewal_inactive_not_due_2": " does not expire until ",
|
|
515
|
-
"renewal_inactive_not_due_3": "Click continue to buy a another licence",
|
|
516
517
|
"renewal_inactive_title_1": "You are renewing this licence too early",
|
|
517
518
|
"renewal_inactive_title_2": "The licence renewal has expired",
|
|
518
519
|
"renewal_inactive_title_3": "You cannot renew an 8 day or 1 day licence",
|
|
520
|
+
"renewal_inactive_title_4": "You can ",
|
|
521
|
+
"renewal_inactive_title_link": "buy a new licence.",
|
|
519
522
|
"renewal_start_date_error_format": "Not a valid date. Enter the date you want the licence to start on and include a day, month and year",
|
|
520
523
|
"renewal_start_date_error_hint_1": "Enter a date between ",
|
|
521
524
|
"renewal_start_date_error_max_1": "Your new licence must start within ",
|
|
@@ -8,8 +8,8 @@ Object {
|
|
|
8
8
|
"preferredMethodOfConfirmation": "email",
|
|
9
9
|
},
|
|
10
10
|
"uri": Object {
|
|
11
|
-
"
|
|
12
|
-
"
|
|
11
|
+
"change": "licence-confirmation-method.url?change=mobile",
|
|
12
|
+
"contact": "contact.url",
|
|
13
13
|
},
|
|
14
14
|
}
|
|
15
15
|
`;
|
|
@@ -1,7 +1,22 @@
|
|
|
1
|
-
import { CONTACT } from '../../../../../uri.js'
|
|
1
|
+
import { CONTACT, LICENCE_CONFIRMATION_METHOD } from '../../../../../uri.js'
|
|
2
2
|
import { HOW_CONTACTED } from '../../../../../processors/mapping-constants.js'
|
|
3
3
|
import { getData } from '../route.js'
|
|
4
4
|
import GetDataRedirect from '../../../../../handlers/get-data-redirect.js'
|
|
5
|
+
import { addLanguageCodeToUri } from '../../../../../processors/uri-helper.js'
|
|
6
|
+
|
|
7
|
+
jest.mock('../../../../../processors/uri-helper.js')
|
|
8
|
+
jest.mock('../../../../../processors/mapping-constants.js', () => ({
|
|
9
|
+
HOW_CONTACTED: {
|
|
10
|
+
none: 'nada',
|
|
11
|
+
email: 'e-mail',
|
|
12
|
+
text: 'mobile-phone'
|
|
13
|
+
}
|
|
14
|
+
}))
|
|
15
|
+
jest.mock('../../../../../uri.js', () => ({
|
|
16
|
+
...jest.requireActual('../../../../../uri.js'),
|
|
17
|
+
CONTACT: { uri: 'contact.url' },
|
|
18
|
+
LICENCE_CONFIRMATION_METHOD: { uri: 'licence-confirmation-method.url' }
|
|
19
|
+
}))
|
|
5
20
|
|
|
6
21
|
describe('.getData', () => {
|
|
7
22
|
const createRequestMock = (options = {}) => ({
|
|
@@ -20,13 +35,42 @@ describe('.getData', () => {
|
|
|
20
35
|
}))
|
|
21
36
|
})
|
|
22
37
|
|
|
38
|
+
beforeEach(jest.resetAllMocks)
|
|
39
|
+
|
|
23
40
|
it('if preferred method of confirmation is none, redirects to contact page', async () => {
|
|
24
41
|
const getDataRedirectError = new GetDataRedirect(CONTACT.uri)
|
|
25
42
|
const func = async () => await getData(createRequestMock({ preferredMethodOfConfirmation: HOW_CONTACTED.none }))
|
|
26
43
|
await expect(func).rejects.toThrow(getDataRedirectError)
|
|
27
44
|
})
|
|
28
45
|
|
|
46
|
+
describe.each([
|
|
47
|
+
{ urlName: 'change', url: `${LICENCE_CONFIRMATION_METHOD.uri}?change=email`, preferredMethodOfConfirmation: HOW_CONTACTED.email },
|
|
48
|
+
{ urlName: 'change', url: `${LICENCE_CONFIRMATION_METHOD.uri}?change=mobile`, preferredMethodOfConfirmation: HOW_CONTACTED.text },
|
|
49
|
+
{ urlName: 'contact', url: CONTACT.uri, preferredMethodOfConfirmation: HOW_CONTACTED.email }
|
|
50
|
+
])('$urlName $confirmation is decorated by addLanguageCodeToUri', ({ urlName, url, preferredMethodOfConfirmation }) => {
|
|
51
|
+
it(`passes request and ${urlName} url to addLanguageCodeToUri`, async () => {
|
|
52
|
+
const request = createRequestMock({ preferredMethodOfConfirmation })
|
|
53
|
+
await getData(request)
|
|
54
|
+
expect(addLanguageCodeToUri).toHaveBeenCalledWith(request, url)
|
|
55
|
+
})
|
|
56
|
+
|
|
57
|
+
it(`returns decorated value for ${urlName} from addLanguageCodeToUri`, async () => {
|
|
58
|
+
const expectedUrl = Symbol(urlName)
|
|
59
|
+
addLanguageCodeToUri.mockReturnValue(expectedUrl)
|
|
60
|
+
const request = createRequestMock()
|
|
61
|
+
const data = await getData(request)
|
|
62
|
+
expect(data).toEqual(
|
|
63
|
+
expect.objectContaining({
|
|
64
|
+
uri: expect.objectContaining({
|
|
65
|
+
[urlName]: expectedUrl
|
|
66
|
+
})
|
|
67
|
+
})
|
|
68
|
+
)
|
|
69
|
+
})
|
|
70
|
+
})
|
|
71
|
+
|
|
29
72
|
it('returns the expected data', async () => {
|
|
73
|
+
addLanguageCodeToUri.mockImplementation((_request, uri) => uri)
|
|
30
74
|
expect(await getData(createRequestMock())).toMatchSnapshot()
|
|
31
75
|
})
|
|
32
76
|
})
|
package/src/pages/contact/digital-licence/check-confirmation-contact/check-confirmation-contact.njk
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
{% extends "standard-form.njk" %}
|
|
2
2
|
{% from "back-link/macro.njk" import govukBackLink %}
|
|
3
3
|
|
|
4
|
-
|
|
5
4
|
{% if data.licensee.preferredMethodOfConfirmation == 'Email' %}
|
|
6
5
|
{% set contactType = mssgs.email_address %}
|
|
7
6
|
{% set contactInfo = data.licensee.email %}
|
|
8
|
-
{% set changeLinkUrl = data.uri.licenceConfirmationMethod + '?change=email' %}
|
|
9
7
|
{% else %}
|
|
10
8
|
{% set contactType = mssgs.phone_number %}
|
|
11
9
|
{% set contactInfo = data.licensee.mobilePhone %}
|
|
12
|
-
{% set changeLinkUrl = data.uri.licenceConfirmationMethod + '?change=mobile' %}
|
|
13
10
|
{% endif %}
|
|
14
11
|
|
|
15
12
|
{% set title = mssgs.check_conf_contact_title_1 + contactType + mssgs.check_conf_contact_title_2 %}
|
|
@@ -36,7 +33,7 @@
|
|
|
36
33
|
</p>
|
|
37
34
|
|
|
38
35
|
<p class="govuk-body govuk-!-margin-bottom-6">
|
|
39
|
-
<a class="govuk-link" href="{{
|
|
36
|
+
<a class="govuk-link" href="{{ data.uri.change }}">
|
|
40
37
|
{{ mssgs.licence_summary_change }} {{ contactType }}
|
|
41
38
|
</a>
|
|
42
39
|
</p>
|
|
@@ -3,6 +3,7 @@ import { HOW_CONTACTED } from '../../../../processors/mapping-constants.js'
|
|
|
3
3
|
import GetDataRedirect from '../../../../handlers/get-data-redirect.js'
|
|
4
4
|
import pageRoute from '../../../../routes/page-route.js'
|
|
5
5
|
import { nextPage } from '../../../../routes/next-page.js'
|
|
6
|
+
import { addLanguageCodeToUri } from '../../../../processors/uri-helper.js'
|
|
6
7
|
|
|
7
8
|
export const getData = async request => {
|
|
8
9
|
const { licensee } = await request.cache().helpers.transaction.getCurrentPermission()
|
|
@@ -11,11 +12,14 @@ export const getData = async request => {
|
|
|
11
12
|
throw new GetDataRedirect(CONTACT.uri)
|
|
12
13
|
}
|
|
13
14
|
|
|
15
|
+
const whatToChange = licensee.preferredMethodOfConfirmation === HOW_CONTACTED.email ? '?change=email' : '?change=mobile'
|
|
16
|
+
const change = addLanguageCodeToUri(request, `${LICENCE_CONFIRMATION_METHOD.uri}${whatToChange}`)
|
|
17
|
+
|
|
14
18
|
return {
|
|
15
19
|
licensee,
|
|
16
20
|
uri: {
|
|
17
|
-
|
|
18
|
-
|
|
21
|
+
contact: addLanguageCodeToUri(request, CONTACT.uri),
|
|
22
|
+
change
|
|
19
23
|
}
|
|
20
24
|
}
|
|
21
25
|
}
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
</ul>
|
|
25
25
|
|
|
26
26
|
<p class="govuk-body">{{ mssgs.access_statement_made_simple }}</p>
|
|
27
|
-
<p class="govuk-body"
|
|
27
|
+
<p class="govuk-body">{{ mssgs.access_statement_ability_net_1 }}<a href="https://mcmw.abilitynet.org.uk/" class="govuk-link">{{ mssgs.access_statement_ability_net_link}}</a>{{ mssgs.access_statement_ability_net_2 }}</p>
|
|
28
28
|
|
|
29
29
|
<h2 class="govuk-heading-m">{{ mssgs.access_statement_how_subheading }}</h2>
|
|
30
30
|
<p class="govuk-body">{{ mssgs.access_statement_how_info }}</p>
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
<li>{{ mssgs.facebook_bulletpoint }}<a href="https://www.facebook.com/environmentagency" class="govuk-link">{{ mssgs.facebook_bulletpoint_link }}</a></li>
|
|
59
59
|
</ul>
|
|
60
60
|
<p class="govuk-body">{{ mssgs.access_statement_visit }}</p>
|
|
61
|
-
<p class="govuk-body">{{ mssgs.
|
|
61
|
+
<p class="govuk-body">{{ mssgs.access_statement_visit_info_1 }}<a href="https://www.gov.uk/government/organisations/environment-agency/about/access-and-opening" class="govuk-link">{{ mssgs.access_statement_visit_info_link }}</a>{{ mssgs.access_statement_visit_info_2 }}</p>
|
|
62
62
|
<p class="govuk-body">{{ mssgs.access_statement_visit_info_text_serivce }}</p>
|
|
63
63
|
|
|
64
64
|
<h2 class="govuk-heading-m">{{ mssgs.access_statement_tech_heading }}</h2>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getData } from '../route'
|
|
2
2
|
import '../../../../processors/pricing-summary.js'
|
|
3
|
-
import '../../../../processors/licence-type-display.js'
|
|
3
|
+
import { licenceTypeDisplay } from '../../../../processors/licence-type-display.js'
|
|
4
4
|
|
|
5
5
|
jest.mock('../../../../processors/pricing-summary.js')
|
|
6
6
|
jest.mock('../../../../processors/licence-type-display.js')
|
|
@@ -15,7 +15,10 @@ describe('licence-length > route', () => {
|
|
|
15
15
|
getCurrentPermission: mockTransactionCacheGet
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
|
-
})
|
|
18
|
+
}),
|
|
19
|
+
i18n: {
|
|
20
|
+
getCatalog: () => ({})
|
|
21
|
+
}
|
|
19
22
|
}
|
|
20
23
|
|
|
21
24
|
describe('getData', () => {
|
|
@@ -30,5 +33,32 @@ describe('licence-length > route', () => {
|
|
|
30
33
|
const result = await getData(mockRequest)
|
|
31
34
|
expect(result.isLicenceForYou).toBeFalsy()
|
|
32
35
|
})
|
|
36
|
+
|
|
37
|
+
it('licenceTypeDisplay is called with the expected arguments', async () => {
|
|
38
|
+
const catalog = Symbol('mock catalog')
|
|
39
|
+
const permission = Symbol('mock permission')
|
|
40
|
+
const sampleRequest = {
|
|
41
|
+
...mockRequest,
|
|
42
|
+
i18n: {
|
|
43
|
+
getCatalog: () => catalog
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
mockTransactionCacheGet.mockImplementationOnce(() => permission)
|
|
47
|
+
|
|
48
|
+
await getData(sampleRequest)
|
|
49
|
+
|
|
50
|
+
expect(licenceTypeDisplay).toHaveBeenCalledWith(permission, catalog)
|
|
51
|
+
})
|
|
52
|
+
|
|
53
|
+
it('return value of licenceTypeDisplay is used for licenceTypeStr', async () => {
|
|
54
|
+
const returnValue = Symbol('return value')
|
|
55
|
+
licenceTypeDisplay.mockReturnValueOnce(returnValue)
|
|
56
|
+
mockTransactionCacheGet.mockImplementationOnce(() => ({ isLicenceForYou: false }))
|
|
57
|
+
|
|
58
|
+
const result = await getData(mockRequest)
|
|
59
|
+
const ret = result.licenceTypeStr
|
|
60
|
+
|
|
61
|
+
expect(ret).toEqual(returnValue)
|
|
62
|
+
})
|
|
33
63
|
})
|
|
34
64
|
})
|