@defra-fish/gafl-webapp-service 1.55.0-rc.0 → 1.55.0-rc.2

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defra-fish/gafl-webapp-service",
3
- "version": "1.55.0-rc.0",
3
+ "version": "1.55.0-rc.2",
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.55.0-rc.0",
40
- "@defra-fish/connectors-lib": "1.55.0-rc.0",
39
+ "@defra-fish/business-rules-lib": "1.55.0-rc.2",
40
+ "@defra-fish/connectors-lib": "1.55.0-rc.2",
41
41
  "@defra/hapi-gapi": "^2.0.0",
42
42
  "@hapi/boom": "^9.1.2",
43
43
  "@hapi/catbox-redis": "^6.0.2",
@@ -80,5 +80,5 @@
80
80
  "./gafl-jest-matchers.js"
81
81
  ]
82
82
  },
83
- "gitHead": "4f9605d647641cf38a1a0c90381c383aaa723774"
83
+ "gitHead": "9c7ffaba65b8275be19d27f4b862d93b6e20d8a7"
84
84
  }
@@ -466,11 +466,11 @@
466
466
  "licence_type_payment_edge_case": "Mae’n rhaid i chi gwblhau eich taliad cyn 11:30pm ar 31 Mawrth 2024 i dalu’r pris a ddangosir",
467
467
  "licence_type_radio_salmon_hint": "Mae'n cynnwys brithyllod a physgod bras (hyd at 3 gwialen)",
468
468
  "licence_type_radio_salmon": "Eogiaid a brithyllod y môr",
469
- "licence_type_radio_salmon_payment_summary": "eogiaid a brithyllod y môr",
469
+ "licence_type_radio_salmon_payment_summary": "Eogiaid a brithyllod y môr",
470
470
  "licence_type_radio_trout_three_rod": "Brithyllod a physgod bras (hyd at 3 gwialen)",
471
- "licence_type_radio_trout_three_rod_payment_summary": "brithyllod a physgod bras (hyd at 3 gwialen)",
471
+ "licence_type_radio_trout_three_rod_payment_summary": "Brithyllod a physgod bras (hyd at 3 gwialen)",
472
472
  "licence_type_radio_trout_two_rod": "Brithyllod a physgod bras (hyd at 2 wialen)",
473
- "licence_type_radio_trout_two_rod_payment_summary": "brithyllod a physgod bras (hyd at 2 wialen)",
473
+ "licence_type_radio_trout_two_rod_payment_summary": "Brithyllod a physgod bras (hyd at 2 wialen)",
474
474
  "licence_type_rules": "rheolau pysgota â gwialen (yn agor ar dudalen newydd)",
475
475
  "licence_type_salmon_acr_note_1": "Yn ôl y gyfraith, mae'n rhaid i chi roi gwybod am ",
476
476
  "licence_type_salmon_acr_note_2": " ffurflen daliadau (yn agor ar dudalen newydd)",
@@ -466,11 +466,11 @@
466
466
  "licence_type_payment_edge_case": "You must complete payment before 11:30pm on 31 March 2024 to get the price shown",
467
467
  "licence_type_radio_salmon_hint": "Includes trout and coarse (up to 3 rods)",
468
468
  "licence_type_radio_salmon": "Salmon and sea trout",
469
- "licence_type_radio_salmon_payment_summary": "salmon and sea trout",
469
+ "licence_type_radio_salmon_payment_summary": "Salmon and sea trout",
470
470
  "licence_type_radio_trout_three_rod": "Trout and coarse (up to 3 rods)",
471
- "licence_type_radio_trout_three_rod_payment_summary": "trout and coarse (up to 3 rods)",
471
+ "licence_type_radio_trout_three_rod_payment_summary": "Trout and coarse (up to 3 rods)",
472
472
  "licence_type_radio_trout_two_rod": "Trout and coarse (up to 2 rods)",
473
- "licence_type_radio_trout_two_rod_payment_summary": "trout and coarse (up to 2 rods)",
473
+ "licence_type_radio_trout_two_rod_payment_summary": "Trout and coarse (up to 2 rods)",
474
474
  "licence_type_rules": "rod fishing rules (opens in new tab)",
475
475
  "licence_type_salmon_acr_note_1": "Licence holders must by law ",
476
476
  "licence_type_salmon_acr_note_2": " report a catch return (opens in new tab)",
@@ -246,6 +246,127 @@ Array [
246
246
  ]
247
247
  `;
248
248
 
249
+ exports[`licence-summary > route licence summary rows creates licence summary name rows for 1 year new three rod licence 1`] = `
250
+ Array [
251
+ Object {
252
+ "actions": Object {
253
+ "items": Array [
254
+ Object {
255
+ "attributes": Object {
256
+ "id": "change-name",
257
+ },
258
+ "href": "/buy/name",
259
+ "text": "contact_summary_change",
260
+ "visuallyHiddenText": "licence_summary_name",
261
+ },
262
+ ],
263
+ },
264
+ "key": Object {
265
+ "text": "licence_summary_name",
266
+ },
267
+ "value": Object {
268
+ "html": "Brenin Pysgotwr",
269
+ },
270
+ },
271
+ Object {
272
+ "actions": Object {
273
+ "items": Array [
274
+ Object {
275
+ "attributes": Object {
276
+ "id": "change-birth-date",
277
+ },
278
+ "href": "/buy/date-of-birth",
279
+ "text": "contact_summary_change",
280
+ "visuallyHiddenText": "licence_summary_dob",
281
+ },
282
+ ],
283
+ },
284
+ "key": Object {
285
+ "text": "licence_summary_dob",
286
+ },
287
+ "value": Object {
288
+ "html": "1st January 1946",
289
+ },
290
+ },
291
+ Object {
292
+ "actions": Object {
293
+ "items": Array [
294
+ Object {
295
+ "attributes": Object {
296
+ "id": "change-licence-type",
297
+ },
298
+ "href": "/buy/licence-type",
299
+ "text": "contact_summary_change",
300
+ "visuallyHiddenText": "licence_summary_type",
301
+ },
302
+ ],
303
+ },
304
+ "key": Object {
305
+ "text": "licence_summary_type",
306
+ },
307
+ "value": Object {
308
+ "html": "Special Canal Licence, Shopping Trollies and Old Wellies",
309
+ },
310
+ },
311
+ Object {
312
+ "key": Object {
313
+ "text": "licence_summary_length",
314
+ },
315
+ "value": Object {
316
+ "html": "licence_type_12m",
317
+ },
318
+ },
319
+ Object {
320
+ "actions": Object {
321
+ "items": Array [
322
+ Object {
323
+ "attributes": Object {
324
+ "id": "change-licence-to-start",
325
+ },
326
+ "href": "/buy/start-kind",
327
+ "text": "contact_summary_change",
328
+ "visuallyHiddenText": "licence_summary_start_date",
329
+ },
330
+ ],
331
+ },
332
+ "key": Object {
333
+ "text": "licence_summary_start_date",
334
+ },
335
+ "value": Object {
336
+ "html": "30licence_summary_minutes_after_payment",
337
+ },
338
+ },
339
+ Object {
340
+ "actions": Object {
341
+ "items": Array [
342
+ Object {
343
+ "attributes": Object {
344
+ "id": "change-benefit-check",
345
+ },
346
+ "href": "/buy/disability-concession",
347
+ "text": "contact_summary_change",
348
+ "visuallyHiddenText": "licence_summary_ni_num",
349
+ },
350
+ ],
351
+ },
352
+ "key": Object {
353
+ "text": "licence_summary_ni_num",
354
+ },
355
+ "value": Object {
356
+ "html": "AB 12 34 56 A",
357
+ },
358
+ },
359
+ Object {
360
+ "key": Object {
361
+ "text": "damage",
362
+ },
363
+ "value": Object {
364
+ "html": "#6",
365
+ },
366
+ },
367
+ ]
368
+ `;
369
+
249
370
  exports[`licence-summary > route licence summary rows creates licence summary name rows for 1 year renewal 1`] = `
250
371
  Array [
251
372
  Object {
@@ -116,7 +116,7 @@ const getMockPermission = (licenseeOverrides = {}) => ({
116
116
  licenceToStart: 'after-payment',
117
117
  licenceStartDate: '2022-11-10',
118
118
  licenceType: 'Trout and coarse',
119
- numberOfRods: '3',
119
+ numberOfRods: '2',
120
120
  permit: { cost: 6 }
121
121
  })
122
122
 
@@ -372,16 +372,17 @@ describe('licence-summary > route', () => {
372
372
 
373
373
  describe('licence summary rows', () => {
374
374
  it.each`
375
- desc | currentPermission
376
- ${'1 year renewal'} | ${getMockPermission()}
377
- ${'1 year new licence'} | ${getMockNewPermission()}
378
- ${'1 year senior renewal'} | ${getMockSeniorPermission()}
379
- ${'8 day licence'} | ${{ ...getMockNewPermission(), licenceLength: '8D' }}
380
- ${'1 day licence'} | ${{ ...getMockNewPermission(), licenceLength: '1D' }}
381
- ${'Junior licence'} | ${getMockJuniorPermission()}
382
- ${'Blue badge concession'} | ${getMockBlueBadgePermission()}
383
- ${'Continuing permission'} | ${getMockContinuingPermission()}
384
- ${'Another date permission'} | ${{ ...getMockPermission(), licenceToStart: 'another-date' }}
375
+ desc | currentPermission
376
+ ${'1 year renewal'} | ${getMockPermission()}
377
+ ${'1 year new licence'} | ${getMockNewPermission()}
378
+ ${'1 year senior renewal'} | ${getMockSeniorPermission()}
379
+ ${'8 day licence'} | ${{ ...getMockNewPermission(), licenceLength: '8D' }}
380
+ ${'1 day licence'} | ${{ ...getMockNewPermission(), licenceLength: '1D' }}
381
+ ${'Junior licence'} | ${getMockJuniorPermission()}
382
+ ${'Blue badge concession'} | ${getMockBlueBadgePermission()}
383
+ ${'Continuing permission'} | ${getMockContinuingPermission()}
384
+ ${'Another date permission'} | ${{ ...getMockPermission(), licenceToStart: 'another-date' }}
385
+ ${'1 year new three rod licence '} | ${{ ...getMockNewPermission(), numberOfRods: '3' }}
385
386
  `('creates licence summary name rows for $desc', async ({ currentPermission }) => {
386
387
  const mockRequest = getMockRequest({ currentPermission })
387
388
  const data = await getData(mockRequest)
@@ -113,12 +113,13 @@ class RowGenerator {
113
113
  }
114
114
 
115
115
  generateLicenceLengthRow () {
116
- return this.generateStandardRow(
117
- 'licence_summary_length',
118
- this.labels[`licence_type_${this.permission.licenceLength.toLowerCase()}`],
119
- LICENCE_LENGTH.uri,
120
- 'change-licence-length'
121
- )
116
+ const args = ['licence_summary_length', this.labels[`licence_type_${this.permission.licenceLength.toLowerCase()}`]]
117
+
118
+ if (this.permission.numberOfRods !== '3') {
119
+ args.push(LICENCE_LENGTH.uri, 'change-licence-length')
120
+ }
121
+
122
+ return this.generateStandardRow(...args)
122
123
  }
123
124
  }
124
125