@defra-fish/gafl-webapp-service 1.55.0-rc.1 → 1.55.0-rc.3

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.1",
3
+ "version": "1.55.0-rc.3",
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.1",
40
- "@defra-fish/connectors-lib": "1.55.0-rc.1",
39
+ "@defra-fish/business-rules-lib": "1.55.0-rc.3",
40
+ "@defra-fish/connectors-lib": "1.55.0-rc.3",
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": "cb1b8a2fec6b22acdb753e2378882460050ba2e8"
83
+ "gitHead": "93ee935785b753646c8547323a3faa88f4374dee"
84
84
  }
@@ -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