Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CRS-1993 Content changes across CRDS #747

Merged
merged 2 commits into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
CRS-1993 Content changes across CRDS
  • Loading branch information
FaizJD030 committed Jun 27, 2024
commit 166e18fd80434c7b2ebc5431c6be7f56e38f983c
25 changes: 25 additions & 0 deletions server/routes/manualEntryRoutes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,31 @@ describe('Tests for /calculation/:nomsId/manual-entry', () => {
})
})

it('GET if there are indeterminate sentences then should have correct content on landing page', () => {
calculateReleaseDatesService.getUnsupportedSentenceOrCalculationMessages.mockResolvedValue([
{
type: 'UNSUPPORTED_SENTENCE',
} as ValidationMessage,
])
prisonerService.getPrisonerDetail.mockResolvedValue(stubbedPrisonerData)
manualCalculationService.hasIndeterminateSentences.mockResolvedValue(true)
return request(app)
.get('/calculation/A1234AA/manual-entry')
.expect(200)
.expect('Content-Type', /html/)
.expect(res => {
const $ = cheerio.load(res.text)
const manualEntryTitle = $('[data-qa=manual-entry-title]').first()
const manualEntryHint = $('[data-qa=manual-entry-hint]').first()
const manualEntryConfirmation = $('[data-qa=entry-crds-nomis]').first()
expect(manualEntryTitle.text().trim()).toStrictEqual('Enter the release dates manually')
expect(manualEntryConfirmation.text().trim()).toStrictEqual('This will be recorded in NOMIS and the CRDS.')
expect(manualEntryHint.text().trim()).toStrictEqual(
"This calculation includes indeterminate sentences. You'll need to enter the tariff dates that have been supplied by PPCS.",
)
})
})

it('GET if there are indeterminate sentences then should have correct content', () => {
calculateReleaseDatesService.getUnsupportedSentenceOrCalculationMessages.mockResolvedValue([
{
Expand Down
8 changes: 4 additions & 4 deletions server/views/pages/manualEntry/manualEntry.njk
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
{% if hasIndeterminateSentences %}
<h1 class="govuk-heading-xl">
Manual date entry required
<h1 class="govuk-heading-xl" data-qa="manual-entry-title">
Enter the release dates manually
</h1>
<p class="govuk-body">This calculation includes indeterminate sentences.</p>
<p class="govuk-body" data-qa="manual-entry-hint">This calculation includes indeterminate sentences. You'll need to enter the tariff dates that have been supplied by PPCS.</p>
<h2 class="govuk-heading-m">What you need to do</h2>
<p>Continue in this service to enter the release dates or eligibility dates you need to record.</p>
<p>If you do not want to record any of these dates, select 'none of these dates apply'.</p>
<p class="govuk-body">This will be recorded in NOMIS.</p>
<p class="govuk-body" data-qa="entry-crds-nomis">This will be recorded in NOMIS and the CRDS.</p>
{% else %}
<h1 class="govuk-heading-xl">
Manual calculation required
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
</summary>
<div class="govuk-details__text">
Some release dates and details are not included because they are not relevant to this person's sentences.
For more information see the <a href="https://www.gov.uk/government/publications/sentence-calculation-policy-framework-determinate-sentenced-prisoners" target="_blank">sentence calculation policy (opens in new tab)</a>
For more information read the <a href="https://www.gov.uk/government/publications/sentence-calculation-policy-framework-determinate-sentenced-prisoners" target="_blank">sentence calculation policy (opens in new tab)</a>
</div>
</details>