@defra-fish/gafl-webapp-service 1.24.0-rc.7 → 1.24.0

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.
Files changed (38) hide show
  1. package/package.json +4 -4
  2. package/src/handlers/__tests__/error-handler.spec.js +84 -49
  3. package/src/handlers/error-handler.js +9 -1
  4. package/src/locales/cy.json +81 -74
  5. package/src/locales/en.json +9 -2
  6. package/src/pages/concessions/disability/route.js +1 -3
  7. package/src/pages/contact/address/select/route.js +1 -4
  8. package/src/pages/contact/contact/__tests__/result-function.spec.js +2 -2
  9. package/src/pages/contact/contact/result-function.js +1 -1
  10. package/src/pages/contact/contact/route.js +1 -3
  11. package/src/pages/contact/digital-licence/licence-confirmation-method/route.js +1 -3
  12. package/src/pages/contact/digital-licence/licence-fulfilment/route.js +1 -3
  13. package/src/pages/errors/client-error.njk +26 -14
  14. package/src/pages/guidance/accessibility-statement.njk +2 -2
  15. package/src/pages/licence-details/licence-for/route.js +1 -3
  16. package/src/pages/licence-details/licence-length/route.js +1 -3
  17. package/src/pages/licence-details/licence-length/update-transaction.js +1 -5
  18. package/src/pages/licence-details/licence-start-time/__tests__/licence-start-time.spec.js +1 -5
  19. package/src/pages/licence-details/licence-start-time/route.js +3 -10
  20. package/src/pages/licence-details/licence-to-start/__tests__/licence-to-start.spec.js +1 -3
  21. package/src/pages/licence-details/licence-to-start/route.js +6 -24
  22. package/src/pages/renewals/identify/__tests__/identity.spec.js +4 -12
  23. package/src/pages/renewals/renewal-start-date/__tests__/renewal-start-date.spec.js +11 -55
  24. package/src/pages/summary/contact-summary/__tests__/route.spec.js +2 -4
  25. package/src/pages/summary/contact-summary/route.js +1 -1
  26. package/src/pages/summary/licence-summary/__tests__/result-function.spec.js +4 -2
  27. package/src/pages/summary/licence-summary/__tests__/route.spec.js +6 -8
  28. package/src/pages/summary/licence-summary/licence-summary.njk +7 -7
  29. package/src/pages/summary/licence-summary/result-function.js +1 -1
  30. package/src/pages/summary/licence-summary/route.js +8 -8
  31. package/src/pages/terms-and-conditions/route.js +1 -3
  32. package/src/processors/__tests__/api-transaction.spec.js +2 -0
  33. package/src/processors/__tests__/renewals-write-cache.spec.js +12 -3
  34. package/src/processors/api-transaction.js +2 -3
  35. package/src/processors/renewals-write-cache.js +3 -4
  36. package/src/routes/__tests__/back-links.spec.js +1 -1
  37. package/src/routes/journey-definition.js +2 -2
  38. package/src/services/address-lookup/__tests__/address-lookup-service.spec.js +21 -14
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defra-fish/gafl-webapp-service",
3
- "version": "1.24.0-rc.7",
3
+ "version": "1.24.0",
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.24.0-rc.7",
40
- "@defra-fish/connectors-lib": "1.24.0-rc.7",
39
+ "@defra-fish/business-rules-lib": "1.24.0",
40
+ "@defra-fish/connectors-lib": "1.24.0",
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": "da3683aebd2547d7a8d2be3668c16c258a073328"
79
+ "gitHead": "c138f45936dbae8ebb917599a53b6cf96c73aaa5"
80
80
  }
@@ -1,34 +1,19 @@
1
1
  import { errorHandler } from '../error-handler.js'
2
2
  import { CLIENT_ERROR } from '../../uri.js'
3
3
 
4
- const mockView = jest.fn(() => ({
5
- code: jest.fn()
6
- }))
7
- const h = {
8
- view: mockView
9
- }
10
-
11
4
  describe('error-handler', () => {
12
5
  describe('errorHandler', () => {
13
6
  beforeEach(jest.clearAllMocks)
14
7
  it('should pass the referer to the view if it is present', async () => {
15
8
  const request = {
9
+ ...getMockRequest(),
16
10
  headers: {
17
11
  referer: 'http://example.com'
18
- },
19
- i18n: {
20
- getCatalog: () => [],
21
- getLocales: () => []
22
- },
23
- response: {
24
- isBoom: true,
25
- output: {
26
- statusCode: 400
27
- }
28
12
  }
29
13
  }
30
- await errorHandler(request, h)
31
- expect(mockView).toBeCalledWith(
14
+ const mockToolkit = getMockToolkit()
15
+ await errorHandler(request, mockToolkit)
16
+ expect(mockToolkit.view).toBeCalledWith(
32
17
  CLIENT_ERROR.page,
33
18
  expect.objectContaining({
34
19
  referer: 'http://example.com'
@@ -37,43 +22,22 @@ describe('error-handler', () => {
37
22
  })
38
23
 
39
24
  it('should not pass the referer to the view if it is not present', async () => {
40
- const request = {
41
- headers: {},
42
- i18n: {
43
- getCatalog: () => [],
44
- getLocales: () => []
45
- },
46
- response: {
47
- isBoom: true,
48
- output: {
49
- statusCode: 400
50
- }
51
- }
52
- }
53
- await errorHandler(request, h)
54
- expect(mockView).toBeCalledWith(
25
+ const request = getMockRequest()
26
+ const mockToolkit = getMockToolkit()
27
+ await errorHandler(request, mockToolkit)
28
+ expect(mockToolkit.view).toBeCalledWith(
55
29
  CLIENT_ERROR.page,
56
30
  expect.not.objectContaining({
57
31
  referer: 'http://example.com'
58
32
  })
59
33
  )
60
34
  })
35
+
61
36
  it('should pass the catalog and language to the view if it is present', async () => {
62
- const request = {
63
- headers: {},
64
- i18n: {
65
- getCatalog: () => [],
66
- getLocales: () => []
67
- },
68
- response: {
69
- isBoom: true,
70
- output: {
71
- statusCode: 400
72
- }
73
- }
74
- }
75
- await errorHandler(request, h)
76
- expect(mockView).toBeCalledWith(
37
+ const request = getMockRequest()
38
+ const mockToolkit = getMockToolkit()
39
+ await errorHandler(request, mockToolkit)
40
+ expect(mockToolkit.view).toBeCalledWith(
77
41
  CLIENT_ERROR.page,
78
42
  expect.objectContaining({
79
43
  mssgs: [],
@@ -81,5 +45,76 @@ describe('error-handler', () => {
81
45
  })
82
46
  )
83
47
  })
48
+
49
+ describe.each([
50
+ [true, { payment_id: 'abc123', href: 'gov.pay.url' }],
51
+ [true, { payment_id: 'def456', href: 'gov-pay-url' }],
52
+ [false, {}]
53
+ ])('includes correct data when paymentInProgress is %p', (paymentInProgress, payment) => {
54
+ it(`includes paymentInProgress flag with value set to ${paymentInProgress} to correspond to presence of payment_id ${payment.payment_id}`, async () => {
55
+ const request = getMockRequest(payment)
56
+ const mockToolkit = getMockToolkit()
57
+ await errorHandler(request, mockToolkit)
58
+ expect(mockToolkit.view).toHaveBeenCalledWith(
59
+ expect.any(String),
60
+ expect.objectContaining({
61
+ paymentInProgress
62
+ })
63
+ )
64
+ })
65
+
66
+ it(`${paymentInProgress ? 'includes' : 'excludes'} govpay url`, async () => {
67
+ const request = getMockRequest(payment)
68
+ const mockToolkit = getMockToolkit()
69
+ await errorHandler(request, mockToolkit)
70
+ if (paymentInProgress) {
71
+ expect(mockToolkit.view).toHaveBeenCalledWith(
72
+ expect.any(String),
73
+ expect.objectContaining({
74
+ uri: expect.objectContaining({
75
+ payment: payment.href
76
+ })
77
+ })
78
+ )
79
+ } else {
80
+ expect(mockToolkit.view).not.toHaveBeenCalledWith(
81
+ expect.any(String),
82
+ expect.objectContaining({
83
+ uri: expect.objectContaining({
84
+ payment: payment.href
85
+ })
86
+ })
87
+ )
88
+ }
89
+ })
90
+ })
91
+ })
92
+
93
+ const getMockToolkit = (view = jest.fn(() => ({ code: () => {} }))) => ({
94
+ view
95
+ })
96
+
97
+ const getMockRequest = (payment = {}) => ({
98
+ cache: () => ({
99
+ helpers: {
100
+ transaction: {
101
+ get: () =>
102
+ Promise.resolve({
103
+ payment
104
+ })
105
+ }
106
+ }
107
+ }),
108
+ headers: {},
109
+ i18n: {
110
+ getCatalog: () => [],
111
+ getLocales: () => []
112
+ },
113
+ response: {
114
+ isBoom: true,
115
+ output: {
116
+ statusCode: 400
117
+ }
118
+ }
84
119
  })
85
120
  })
@@ -11,6 +11,8 @@ export const errorHandler = async (request, h) => {
11
11
  if (!request.response.isBoom) {
12
12
  return h.continue
13
13
  }
14
+ const transaction = await request.cache().helpers.transaction.get()
15
+ const paymentInProgress = transaction?.payment?.payment_id !== undefined
14
16
  const mssgs = request.i18n.getCatalog()
15
17
  const altLang = request.i18n.getLocales().filter(locale => locale !== request.i18n.getLocale())
16
18
  if (Math.floor(request.response.output.statusCode / 100) === 4) {
@@ -23,8 +25,14 @@ export const errorHandler = async (request, h) => {
23
25
  altLang,
24
26
  referer: request?.headers?.referer,
25
27
  clientError: request.response.output.payload,
28
+ paymentInProgress,
26
29
  path: request.path,
27
- uri: { new: NEW_TRANSACTION.uri, controller: CONTROLLER.uri, agreed: AGREED.uri }
30
+ uri: {
31
+ new: NEW_TRANSACTION.uri,
32
+ controller: CONTROLLER.uri,
33
+ agreed: AGREED.uri,
34
+ ...(transaction?.payment?.href ? { payment: transaction.payment.href } : {})
35
+ }
28
36
  })
29
37
  .code(request.response.output.statusCode)
30
38
  } else {
@@ -1,58 +1,60 @@
1
1
  {
2
2
  "access_statement_ability_net_link": "AbilityNet",
3
- "access_statement_ability_net": " has advice on making your device easier to use if you have a disability.",
4
- "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
- "access_statement_bulletpoint_1": "change colours, contrast levels and fonts",
6
- "access_statement_bulletpoint_2": "zoom in up to 200% without the text spilling off the screen",
7
- "access_statement_bulletpoint_3": "navigate most of the website using just a keyboard",
8
- "access_statement_bulletpoint_4": "navigate most of the website using speech recognition software",
9
- "access_statement_bulletpoint_5": "listen to most of the website using a screen reader (including the most recent versions of JAWS, NVDA and VoiceOver)",
10
- "access_statement_burden_title": "Disproportionate burden",
11
- "access_statement_compliance_body_1": "This service is partially compliant with the ",
12
- "access_statement_compliance_body_2": " AA standard, due to the non-compliances listed.",
13
- "access_statement_compliance_body_link": "Web Content Accessibility Guidelines version 2.1",
14
- "access_statement_compliance_heading": "Compliance status",
15
- "access_statement_enforcement_subheading": "Enforcement procedure",
16
- "access_statement_enforcement_body": "The Equality and Human Rights Commission (EHRC) is responsible for enforcing the Public Sector Bodies (Websites and Mobile Applications) (No. 2) Accessibility Regulations 2018 (the 'accessibility regulations'). If you’re not happy with how we respond to your complaint, contact the ",
17
- "access_statement_enforcement_link": "Equality Advisory and Support Service (EASS)",
18
- "access_statement_how_subheading": "How accessible this website is",
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": "email: ",
21
- "access_statement_feedback_info_bulletpoint_2_call": "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": " (Monday to Friday, 8am to 6pm)",
24
- "access_statement_feedback_info": "If you need information on this website in a different format like accessible PDF, large print, easy read, audio recording or braille:",
25
- "access_statement_feedback_subheading": "Feedback and contact information",
26
- "access_statement_heading": "Accessibility statement for Get a rod fishing licence",
27
- "access_statement_how_info_bulletpoint_1": "On the licence start date page, the calendar date picker is not accessible to those using keyboards or screen readers. Users with accessibility requirements are able to enter this date using the standard day, month and year fields.",
28
- "access_statement_how_info_bulletpoint_2": "The historical calendar dates are too low in contrast",
29
- "access_statement_how_info": "All users with access needs can complete the process of buying a fishing rod licence using this service. However we know that some parts of this website are not fully accessible:",
30
- "access_statement_made_simple": "We have also made the website text as simple as possible to understand.",
31
- "access_statement_nonaccess_body": "The content listed below is non-accessible for the following reasons.",
32
- "access_statement_nonaccess_heading": "Non-accessible content",
33
- "access_statement_noncompliance_body_1": "Users are not always notified when conditionally revealed content associated with a radio button or checkbox is expanded or collapsed. This fails ",
34
- "access_statement_noncompliance_body_2": ". We will review this by the end of January 2022.",
35
- "access_statement_noncompliance_body_link": "WCAG 2.1 success criterion 4.1.2 Name, Role, Value",
36
- "access_statement_noncompliance_heading": "Non-compliance with the accessibility regulations",
37
- "access_statement_none": "None.",
38
- "access_statement_not_in_scope_title": "Content that’s not within the scope of the accessibility regulations",
39
- "access_statement_prep_body_1": "This statement was prepared on 23 September 2020. It was last reviewed on 13 October 2021.",
40
- "access_statement_prep_body_2": "The service was audited for accessibility by the Digital Accessibility Centre on 13 April 2021 and by the Department for the Environment Food and Rural Affairs’ web compliance team on 22 April 2021.",
41
- "access_statement_prep_body_3": "We tested the most common steps for getting these types of licence:",
42
- "access_statement_prep_body_4": "The non-compliant elements will be included in ongoing testing and fixing.",
43
- "access_statement_prep_bulletpoint_1": "12 month: coarse and trout",
44
- "access_statement_prep_bulletpoint_2": "12 month: salmon and sea trout ",
45
- "access_statement_prep_bulletpoint_3": "junior",
46
- "access_statement_prep_heading": "Preparation of this accessibility statement",
47
- "access_statement_reporting_info": "We are always looking to improve the accessibility of this website. If you find any problems not listed on this page or think we’re not meeting accessibility requirements, contact:",
48
- "access_statement_reporting_subheading": "Reporting accessibility problems with this website",
49
- "access_statement_tech_body": "The Environment Agency is committed to making its website accessible, in accordance with the Public Sector Bodies (Websites and Mobile Applications) (No. 2) Accessibility Regulations 2018.",
50
- "access_statement_tech_heading": "Technical information about this website’s accessibility",
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": "office access and opening times",
53
- "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
- "access_statement_visit_info": "See the Environment Agency’s ",
55
- "access_statement_visit": "If you visit our offices and need assistance or a British Sign Language interpreter, you should contact us before you visit.",
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",
@@ -121,10 +123,14 @@
121
123
  "client_error_title_forbidden": "Forbidden",
122
124
  "client_error_title_not_found": "Page not found",
123
125
  "client_error_title_unauth": "Unauthorized",
126
+ "client_error_back_during_payment": "This happened because you either closed the browser or used the back button during payment.",
127
+ "client_error_continue_with_payment_pre": "To continue with the payment, ",
128
+ "client_error_continue_with_payment_link": "go back to GOV Pay.",
129
+ "client_error_payment_start_again_pre": "Or, if you wish, you can discard this licence and ",
124
130
  "concession_applied": "Consesiwn wedi’i gynnwys",
125
131
  "contact_summary_title": "Check the contact details",
126
- "contact_us_body": "You can contact us by:",
127
- "contact_us_heading": "Contact us",
132
+ "contact_us_body": "Gallwch gysylltu â ni drwy’r dulliau canlynol:",
133
+ "contact_us_heading": "Cysylltu â ni",
128
134
  "continue": "Parhau",
129
135
  "cookie_banner_close_ex": "cookie banner",
130
136
  "cookie_banner_close": "Close",
@@ -166,6 +172,7 @@
166
172
  "cookies_survey_body_link_3": "SmartSurvey cookies guide",
167
173
  "cookies_survey_subheading": "Our performance survey",
168
174
  "cookies_title": "Cookies - GOV.UK",
175
+ "cost": "Cost",
169
176
  "disability_concession_12_month": "Gall deiliaid trwydded 12 mis fod yn gymwys i gael consesiynau anabledd",
170
177
  "disability_concession_badge_error_msg": "Nodwch rif Bathodyn Glas deiliad y drwydded",
171
178
  "disability_concession_error_choose_option": "Dewiswch un o’r opsiynau.",
@@ -252,7 +259,7 @@
252
259
  "important_info_contact_item_email": "E-bost",
253
260
  "important_info_contact_item_txt": "Neges destun",
254
261
  "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": "We will show you the licence number on confirmation.",
262
+ "important_info_contact_none_msg": "Byddwn yn dangos rhif y drwydded i chi ar ôl cadarnhau.",
256
263
  "important_info_contact_note_tip": "Gwnewch nodyn o rif y drwydded",
257
264
  "important_info_contact_post_confirm_8d": "We don’t provide physical cards for 1 or 8 day licences.",
258
265
  "important_info_contact_post_confirm_jr": "We don’t provide physical cards for junior licences.",
@@ -343,19 +350,19 @@
343
350
  "licence_start_title_other": "Pryd ddylai'r drwydded ddechrau?",
344
351
  "licence_start_title_you": "Pryd yr hoffech i'ch trwydded ddechrau?",
345
352
  "licence_start_today_or_within": "Gall y drwydded ddechrau heddiw neu unrhyw ddiwrnod o fewn y ",
346
- "licence_summary_blue_badge_num": "Blue Badge number",
353
+ "licence_summary_blue_badge_num": "Rhif Bathodyn Glas",
347
354
  "licence_summary_change": "Newid",
348
- "licence_summary_disability_concession": "Disability concession",
349
- "licence_summary_dob": "Date of birth",
355
+ "licence_summary_disability_concession": "Consesiwn anabledd",
356
+ "licence_summary_dob": "Dyddiad geni",
350
357
  "licence_summary_immediately_after_expire": "Immediately after the current licence expires",
351
- "licence_summary_length": "Length",
352
- "licence_summary_minutes_after_payment": " minutes after payment",
353
- "licence_summary_name": "Name",
354
- "licence_summary_ni_num": "National Insurance number",
355
- "licence_summary_none": "None",
356
- "licence_summary_start_date": "Start date",
357
- "licence_summary_title": "Check the licence details",
358
- "licence_summary_type": "Type",
358
+ "licence_summary_length": "Hyd",
359
+ "licence_summary_minutes_after_payment": " munud yn dilyn taliad",
360
+ "licence_summary_name": "Enw",
361
+ "licence_summary_ni_num": "Rhif Yswiriant Gwladol",
362
+ "licence_summary_none": "Dim",
363
+ "licence_summary_start_date": "Dyddiad dechrau",
364
+ "licence_summary_title": "Gwiriwch fanylion y drwydded",
365
+ "licence_summary_type": "Math",
359
366
  "licence_type_12m": "12 mis",
360
367
  "licence_type_1d": "1 diwrnod",
361
368
  "licence_type_8d": "8 niwrnod",
@@ -496,16 +503,16 @@
496
503
  "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
504
  "privacy_where_stored_body_3": "We do not store payment details.",
498
505
  "purpose": "Purpose",
499
- "refund_bulletpoint_1": "The Environment Agency can only refund the cost of a licence to the purchaser. All refund applications should be directed to the Environment Agency, except where the licence has been bought through a third party (other than the Post Office), in which case refund applications should be directed to them. Contact the Environment Agency on 03708 506506.",
500
- "refund_bulletpoint_2_1": "The Environment Agency will not charge a fee when you purchase a licence through our ",
501
- "refund_bulletpoint_2_2": " or the Post Office. We do not recommend purchasing your licence through third-party sites, which may charge a fee on top of the licence cost. If you purchased your licence through a third party, please contact them directly to request a refund of the licence cost and/or fee. The Environment Agency will not refund licence holders for licences purchased through third parties. ",
502
- "refund_bulletpoint_2_link": "website",
503
- "refund_bulletpoint_3": "If you purchase a licence in error or buy the wrong type of licence, for yourself or someone else, the purchaser can request a refund within 14 days of the original purchase date.",
504
- "refund_bulletpoint_4": "Where an error has occurred that is attributable to the Environment Agency or the Post Office, please contact us directly within 14 days of the original purchase date to request a full refund. Contact the Environment Agency on 03708 506506.",
505
- "refund_bulletpoint_5": "No refunds are offered on 1-day or 8-day licences. If you upgrade to a 12-month licence within 14 days of the expiry date of the short-term licence, we will refund the cost of the short-term licence after you have purchased the 12-month licence.",
506
- "refund_bulletpoint_6": "You can request a refund if you upgrade a 2-rod licence to a 3-rod licence, within 14 days of the original purchase date. We will refund the cost of the 2-rod licence after you have purchased the 3-rod licence.",
507
- "refund_bulletpoint_7": "You can request a refund if you upgrade a coarse fish licence to a salmon and sea trout licence within 14 days of the original purchase date. We will refund the cost of the coarse fish licence after you have purchased the salmon and sea trout licence.",
508
- "refund_heading": "Refund policy",
506
+ "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.",
507
+ "refund_bulletpoint_2_1": "Ni fydd Asiantaeth yr Amgylchedd yn codi ffi pan fyddwch yn prynu trwydded drwy ein ",
508
+ "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.",
509
+ "refund_bulletpoint_2_link": "gwefan",
510
+ "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.",
511
+ "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.",
512
+ "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.",
513
+ "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.",
514
+ "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.",
515
+ "refund_heading": "Polisi ad-dalu",
509
516
  "refund_title": "Refund policy - GOV.UK",
510
517
  "renewal_inactive_has_expired_1": " has expired on ",
511
518
  "renewal_inactive_has_expired_2": " and can no longer be renewed",
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "access_statement_ability_net_link": "AbilityNet",
3
- "access_statement_ability_net": " has advice on making your device easier to use if you have a disability.",
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
- "access_statement_visit_info": "See the Environment Agency’s ",
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",
@@ -121,6 +123,10 @@
121
123
  "client_error_title_forbidden": "Forbidden",
122
124
  "client_error_title_not_found": "Page not found",
123
125
  "client_error_title_unauth": "Unauthorized",
126
+ "client_error_back_during_payment": "This happened because you either closed the browser or used the back button during payment.",
127
+ "client_error_continue_with_payment_pre": "To continue with the payment, ",
128
+ "client_error_continue_with_payment_link": "go back to GOV Pay.",
129
+ "client_error_payment_start_again_pre": "Or, if you wish, you can discard this licence and ",
124
130
  "concession_applied": "Concession applied",
125
131
  "contact_summary_title": "Check the contact details",
126
132
  "contact_us_body": "You can contact us by:",
@@ -166,6 +172,7 @@
166
172
  "cookies_survey_body_link_3": "SmartSurvey cookies guide",
167
173
  "cookies_survey_subheading": "Our performance survey",
168
174
  "cookies_title": "Cookies - GOV.UK",
175
+ "cost": "Cost",
169
176
  "disability_concession_12_month": "12 month licence holders may be eligible for disability concessions",
170
177
  "disability_concession_badge_error_msg": "Enter the licence holder’s Blue Badge number",
171
178
  "disability_concession_error_choose_option": "Choose one of the options.",
@@ -17,9 +17,7 @@ const validator = Joi.object({
17
17
  }),
18
18
  'blue-badge-number': Joi.alternatives().conditional('disability-concession', {
19
19
  is: disabilityConcessionTypes.blueBadge,
20
- then: Joi.string()
21
- .max(25)
22
- .required(),
20
+ then: Joi.string().max(25).required(),
23
21
  otherwise: Joi.string().empty('')
24
22
  })
25
23
  }).options({ abortEarly: false, allowUnknown: true })
@@ -20,10 +20,7 @@ export default pageRoute(
20
20
  ADDRESS_SELECT.page,
21
21
  ADDRESS_SELECT.uri,
22
22
  Joi.object({
23
- address: Joi.number()
24
- .integer()
25
- .min(0)
26
- .required()
23
+ address: Joi.number().integer().min(0).required()
27
24
  }).options({ abortEarly: false, allowUnknown: true }),
28
25
  nextPage,
29
26
  getData
@@ -46,13 +46,13 @@ describe('contact > result-function', () => {
46
46
  })
47
47
 
48
48
  it('should return ok if renewal is false', async () => {
49
- mockStatusCacheGet.mockImplementationOnce(() => ({ renewal: false }))
49
+ mockTransactionCacheGet.mockImplementationOnce(() => ({ isRenewal: false }))
50
50
  const result = await resultFunction(mockRequest)
51
51
  expect(result).toBe(CommonResults.OK)
52
52
  })
53
53
 
54
54
  it('should return summary if renewal is true', async () => {
55
- mockStatusCacheGet.mockImplementationOnce(() => ({ renewal: true }))
55
+ mockTransactionCacheGet.mockImplementationOnce(() => ({ isRenewal: true }))
56
56
  const result = await resultFunction(mockRequest)
57
57
  expect(result).toBe(CommonResults.SUMMARY)
58
58
  })
@@ -4,7 +4,7 @@ export default async request => {
4
4
  const status = await request.cache().helpers.status.getCurrentPermission()
5
5
  const transaction = await request.cache().helpers.transaction.getCurrentPermission()
6
6
 
7
- return transaction.isLicenceForYou === false || status.fromSummary === CONTACT_SUMMARY_SEEN || status.renewal
7
+ return transaction.isLicenceForYou === false || status.fromSummary === CONTACT_SUMMARY_SEEN || transaction.isRenewal
8
8
  ? CommonResults.SUMMARY
9
9
  : CommonResults.OK
10
10
  }
@@ -36,9 +36,7 @@ export const getData = async request => {
36
36
  }
37
37
 
38
38
  export const validator = Joi.object({
39
- 'how-contacted': Joi.string()
40
- .valid('email', 'text', 'none')
41
- .required(),
39
+ 'how-contacted': Joi.string().valid('email', 'text', 'none').required(),
42
40
  email: Joi.alternatives().conditional('how-contacted', {
43
41
  is: 'email',
44
42
  then: validation.contact.createEmailValidator(Joi),
@@ -28,9 +28,7 @@ export const getData = async request => {
28
28
  }
29
29
 
30
30
  const validator = Joi.object({
31
- 'licence-confirmation-method': Joi.string()
32
- .valid('email', 'text', 'none')
33
- .required(),
31
+ 'licence-confirmation-method': Joi.string().valid('email', 'text', 'none').required(),
34
32
  text: Joi.alternatives().conditional('licence-confirmation-method', {
35
33
  is: 'text',
36
34
  then: mobilePhoneValidator,
@@ -18,9 +18,7 @@ export const getData = async request => {
18
18
  }
19
19
 
20
20
  const validator = Joi.object({
21
- 'licence-option': Joi.string()
22
- .valid('digital', 'paper-licence')
23
- .required()
21
+ 'licence-option': Joi.string().valid('digital', 'paper-licence').required()
24
22
  }).options({ abortEarly: false, allowUnknown: true })
25
23
 
26
24
  export default pageRoute(LICENCE_FULFILMENT.page, LICENCE_FULFILMENT.uri, validator, nextPage, getData)