Skip to content

Commit

Permalink
CRS-1975 Print Slip Design Adjustments (#721)
Browse files Browse the repository at this point in the history
  • Loading branch information
FaizJD030 committed Jun 6, 2024
1 parent 7765fbf commit 995ef0a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
4 changes: 2 additions & 2 deletions assets/scss/_print.scss
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@
.offender-title {
text-align: center;
font-family: Arial, Helvetica, sans-serif;
font-size: 10px;
font-size: 16px;
margin-bottom: 2px;
}

.establishment-title {
text-align: center;
font-family: Arial, Helvetica, sans-serif;
font-size: 10px;
font-size: 16px;
margin-bottom: 2px;
}

Expand Down
13 changes: 9 additions & 4 deletions server/routes/viewRoutes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1238,7 +1238,7 @@ describe('View journey routes tests', () => {
expect(prisonerCell.text()).toContain('D-2-003')
expect(offenderNumber.text()).toContain('A1234AA')
expect(releaseDatesTitle.text()).toContain('Release dates')
expect(calculationDate.text()).toStrictEqual('These release dates were calculated on 01 June 2020')
expect(calculationDate.text()).toStrictEqual('These release dates were calculated on 01 June 2020.')
expect(crdTitle.text()).toContain('CRD (Conditional release date)')
expect(crdDate.text()).toContain('03 February 2021')
expect(sedTitle.text()).toContain('SED (Sentence expiry date)')
Expand Down Expand Up @@ -1308,7 +1308,7 @@ describe('View journey routes tests', () => {
expect(calcReasonTitle.length).toStrictEqual(0)
expect(calcReason.length).toStrictEqual(0)
expect(checkedBy.length).toStrictEqual(0)
expect(pageTitleCaption.text()).toStrictEqual('[Offender copy]')
expect(pageTitleCaption.text()).toStrictEqual("[Anon Nobody's copy]")
expect(offenderHDCED.text()).toStrictEqual(
'Release on HDC (Home Detention Curfew) is subject to an assessment.',
)
Expand Down Expand Up @@ -1542,7 +1542,7 @@ describe('View journey routes tests', () => {
})
})

it('GET /calculation/:nomsId/summary/:calculationRequestId/printNotificationSlip?fromPage=calculation should generate correct content for missing Agency Name, keyDates and Adjustments', () => {
it('GET /calculation/:nomsId/summary/:calculationRequestId/printNotificationSlip?fromPage=calculation&pageType=offender should generate correct content for Offender Name, Agency Name, keyDates and Adjustments', () => {
const stubbedNoReleaseDates: ReleaseDatesAndCalculationContext = {
calculation: {
calculationRequestId: 51245,
Expand All @@ -1566,6 +1566,9 @@ describe('View journey routes tests', () => {
bookingAdjustments: [],
} as AnalyzedPrisonApiBookingAndSentenceAdjustments
const stubbedNoPrisonPrisonerData = {
offenderNo: 'A1234AA',
firstName: 'Anon',
lastName: 'Bloggs',
sentenceDetail: {} as PrisonApiSentenceDetail,
assignedLivingUnit: {} as PrisonAPIAssignedLivingUnit,
} as PrisonApiPrisoner
Expand All @@ -1574,7 +1577,7 @@ describe('View journey routes tests', () => {
viewReleaseDatesService.getBookingAndSentenceAdjustments.mockResolvedValue(stubbedNoAdjustments)
calculateReleaseDatesService.getReleaseDatesForACalcReqId.mockResolvedValue(stubbedNoReleaseDates)
return request(app)
.get('/calculation/A1234AA/summary/123456/printNotificationSlip?fromPage=calculation')
.get('/calculation/A1234AA/summary/123456/printNotificationSlip?fromPage=calculation&pageType=offender')
.expect(200)
.expect('Content-Type', /html/)
.expect(res => {
Expand All @@ -1585,7 +1588,9 @@ describe('View journey routes tests', () => {
const prisonerCell = $('[data-qa=prisoner-cell]').first()
const dtoTitle = $('[data-qa=dto-title]').first()
const dtoText = $('[data-qa=dto-text]').first()
const pageTitleCaption = $('[data-qa="page-title-caption"]').first()

expect(pageTitleCaption.text()).toStrictEqual("[Anon Bloggs' copy]")
expect(noKeyDates.text()).toStrictEqual('No key dates available.')
expect(noAdjustments.text()).toStrictEqual('There are no adjustments.')
expect(prisonTitle.text()).toContain('No agency name available')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<body class="govuk-template__body js-enabled" data-new-gr-c-s-check-loaded="14.1110.0" data-gr-ext-installed="">

<div class="print-width-container">
<div class="moj-width-container govuk-!-margin-bottom-4 govuk-!-display-none-print">
<div class="moj-width-container govuk-!-margin-bottom-4 govuk-!-display-none-print" style="padding-top: 30px;">
{% if fromPage == 'calculation' %}
<a data-qa="back-link" class="govuk-back-link" href="/calculation/{{ model.prisonerDetail.offenderNo }}/complete/{{ calculationRequestId }}">Back</a>
{% elif fromPage == 'view' %}
Expand Down Expand Up @@ -51,7 +51,7 @@
<div class="notification-slip">

{% if pageType == 'offender' %}
<div data-qa="page-title-caption" class="offender-title">[Offender copy]</div>
<div data-qa="page-title-caption" class="offender-title">[{{ model.prisonerDetail.firstName | title + ' ' + model.prisonerDetail.lastName | title | pluraliseName}} copy]</div>
{% elif pageType == 'establishment' %}
<div data-qa="page-title-caption" class="establishment-title">[Establishment copy]</div>
{% endif %}
Expand All @@ -73,7 +73,7 @@

<div class="govuk-grid-row">
<div class="govuk-grid-column-full">
<p class="govuk-body" data-qa="calculation-date">These release dates were calculated on {{ calculationDate | date('DD MMMM YYYY') }}</p>
<p class="govuk-body" data-qa="calculation-date">These release dates were calculated on {{ calculationDate | date('DD MMMM YYYY') }}.</p>

{% if pageType == 'establishment' %}
<dl class="govuk-summary-list govuk-summary-list--no-border govuk-!-margin-bottom-4">
Expand Down

0 comments on commit 995ef0a

Please sign in to comment.