Skip to content

Commit

Permalink
Change links for three rod licence (#2077)
Browse files Browse the repository at this point in the history
* Change links for three rod licence

https://eaflood.atlassian.net/browse/IWTF-3785

Remove change link for changing length for three rod licences on summary page

* hide change link for lenght for three rod licence

* lint

* remove changes from this branch

* check only number of rods not type
  • Loading branch information
ScottDormand96 authored Nov 19, 2024
1 parent cb1b8a2 commit fa2d8af
Show file tree
Hide file tree
Showing 3 changed files with 140 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,127 @@ Array [
]
`;

exports[`licence-summary > route licence summary rows creates licence summary name rows for 1 year new three rod licence 1`] = `
Array [
Object {
"actions": Object {
"items": Array [
Object {
"attributes": Object {
"id": "change-name",
},
"href": "/buy/name",
"text": "contact_summary_change",
"visuallyHiddenText": "licence_summary_name",
},
],
},
"key": Object {
"text": "licence_summary_name",
},
"value": Object {
"html": "Brenin Pysgotwr",
},
},
Object {
"actions": Object {
"items": Array [
Object {
"attributes": Object {
"id": "change-birth-date",
},
"href": "/buy/date-of-birth",
"text": "contact_summary_change",
"visuallyHiddenText": "licence_summary_dob",
},
],
},
"key": Object {
"text": "licence_summary_dob",
},
"value": Object {
"html": "1st January 1946",
},
},
Object {
"actions": Object {
"items": Array [
Object {
"attributes": Object {
"id": "change-licence-type",
},
"href": "/buy/licence-type",
"text": "contact_summary_change",
"visuallyHiddenText": "licence_summary_type",
},
],
},
"key": Object {
"text": "licence_summary_type",
},
"value": Object {
"html": "Special Canal Licence, Shopping Trollies and Old Wellies",
},
},
Object {
"key": Object {
"text": "licence_summary_length",
},
"value": Object {
"html": "licence_type_12m",
},
},
Object {
"actions": Object {
"items": Array [
Object {
"attributes": Object {
"id": "change-licence-to-start",
},
"href": "/buy/start-kind",
"text": "contact_summary_change",
"visuallyHiddenText": "licence_summary_start_date",
},
],
},
"key": Object {
"text": "licence_summary_start_date",
},
"value": Object {
"html": "30licence_summary_minutes_after_payment",
},
},
Object {
"actions": Object {
"items": Array [
Object {
"attributes": Object {
"id": "change-benefit-check",
},
"href": "/buy/disability-concession",
"text": "contact_summary_change",
"visuallyHiddenText": "licence_summary_ni_num",
},
],
},
"key": Object {
"text": "licence_summary_ni_num",
},
"value": Object {
"html": "AB 12 34 56 A",
},
},
Object {
"key": Object {
"text": "damage",
},
"value": Object {
"html": "#6",
},
},
]
`;

exports[`licence-summary > route licence summary rows creates licence summary name rows for 1 year renewal 1`] = `
Array [
Object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ const getMockPermission = (licenseeOverrides = {}) => ({
licenceToStart: 'after-payment',
licenceStartDate: '2022-11-10',
licenceType: 'Trout and coarse',
numberOfRods: '3',
numberOfRods: '2',
permit: { cost: 6 }
})

Expand Down Expand Up @@ -372,16 +372,17 @@ describe('licence-summary > route', () => {

describe('licence summary rows', () => {
it.each`
desc | currentPermission
${'1 year renewal'} | ${getMockPermission()}
${'1 year new licence'} | ${getMockNewPermission()}
${'1 year senior renewal'} | ${getMockSeniorPermission()}
${'8 day licence'} | ${{ ...getMockNewPermission(), licenceLength: '8D' }}
${'1 day licence'} | ${{ ...getMockNewPermission(), licenceLength: '1D' }}
${'Junior licence'} | ${getMockJuniorPermission()}
${'Blue badge concession'} | ${getMockBlueBadgePermission()}
${'Continuing permission'} | ${getMockContinuingPermission()}
${'Another date permission'} | ${{ ...getMockPermission(), licenceToStart: 'another-date' }}
desc | currentPermission
${'1 year renewal'} | ${getMockPermission()}
${'1 year new licence'} | ${getMockNewPermission()}
${'1 year senior renewal'} | ${getMockSeniorPermission()}
${'8 day licence'} | ${{ ...getMockNewPermission(), licenceLength: '8D' }}
${'1 day licence'} | ${{ ...getMockNewPermission(), licenceLength: '1D' }}
${'Junior licence'} | ${getMockJuniorPermission()}
${'Blue badge concession'} | ${getMockBlueBadgePermission()}
${'Continuing permission'} | ${getMockContinuingPermission()}
${'Another date permission'} | ${{ ...getMockPermission(), licenceToStart: 'another-date' }}
${'1 year new three rod licence '} | ${{ ...getMockNewPermission(), numberOfRods: '3' }}
`('creates licence summary name rows for $desc', async ({ currentPermission }) => {
const mockRequest = getMockRequest({ currentPermission })
const data = await getData(mockRequest)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,13 @@ class RowGenerator {
}

generateLicenceLengthRow () {
return this.generateStandardRow(
'licence_summary_length',
this.labels[`licence_type_${this.permission.licenceLength.toLowerCase()}`],
LICENCE_LENGTH.uri,
'change-licence-length'
)
const args = ['licence_summary_length', this.labels[`licence_type_${this.permission.licenceLength.toLowerCase()}`]]

if (this.permission.numberOfRods !== '3') {
args.push(LICENCE_LENGTH.uri, 'change-licence-length')
}

return this.generateStandardRow(...args)
}
}

Expand Down

0 comments on commit fa2d8af

Please sign in to comment.