Skip to content

Commit

Permalink
MAN-325 update criminogenic headings on risk page (#312)
Browse files Browse the repository at this point in the history
  • Loading branch information
neil-mills authored Feb 6, 2025
1 parent c7291e9 commit d2c3f8c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 14 deletions.
9 changes: 7 additions & 2 deletions integration_tests/e2e/risk.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,13 @@ context('Risk', () => {
it('Risk overview page is rendered', () => {
cy.visit('/case/X000001/risk')
const page = Page.verifyOnPage(RiskPage)
page.getElementData('highScoringNeedsValue').should('contain.text', 'Relationships')
page.getElementData('lowScoringNeedsValue').should('contain.text', 'Accommodation')
page.getElementData('severeScoringNeedsLabel').should('contain.text', 'Severe-scoring areas from the assessment')
page.getElementData('severeScoringNeedsValue').should('contain.text', 'Relationships')
page
.getElementData('standardScoringNeedsLabel')
.should('contain.text', 'Standard-scoring areas from the assessment')
page.getElementData('standardScoringNeedsValue').should('contain.text', 'Accommodation')
page.getElementData('noScoreNeedsLabel').should('contain.text', 'Areas without a need score')
page.getElementData('noScoreNeedsValue').should('contain.text', 'Emotional wellbeing')
page.getElementData('mappa-heading').should('contain.text', 'Cat 0/Level 2')
})
Expand Down
24 changes: 12 additions & 12 deletions server/views/pages/risk.njk
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@
{% set headerDob = personRisk.personSummary.dateOfBirth %}
{% set headerGender = personRisk.personSummary.gender %}
{% set hasRiskAssessment = risks.assessedOn %}
{% set highScoring = groupNeeds("SEVERE", needs.identifiedNeeds) %}
{% set lowScoring = groupNeeds("STANDARD", needs.identifiedNeeds) %}
{% set severeScoring = groupNeeds("SEVERE", needs.identifiedNeeds) %}
{% set standardScoring = groupNeeds("STANDARD", needs.identifiedNeeds) %}
{% set withoutScore = needs.notIdentifiedNeeds %}
{% if risks.assessedOn %}
{% set lastUpdatedDate = 'Last updated (OASys):' + risks.assessedOn | dateWithYear %}
{% endif %}

{% set highScoringNeeds %}
{% if highScoring.length > 0 %}
{% set severeScoringNeeds %}
{% if severeScoring.length > 0 %}
<ul class="govuk-list">
{% for need in highScoring %}
{% for need in severeScoring %}
<li>
{{ need.name }}
</li>
Expand All @@ -35,10 +35,10 @@
{% endif %}
{% endset %}

{% set lowScoringNeeds %}
{% if lowScoring.length > 0 %}
{% set standardScoringNeeds %}
{% if standardScoring.length > 0 %}
<ul class="govuk-list">
{% for need in lowScoring %}
{% for need in standardScoring %}
<li>
{{ need.name }}
</li>
Expand Down Expand Up @@ -93,12 +93,12 @@
{{ govukSummaryList({
rows: [
{
key: { html: '<span data-qa="highScoringNeedsLabel">High-scoring areas from the assessment</span>' },
value: { html: '<span data-qa="highScoringNeedsValue">' + highScoringNeeds + '</span>' }
key: { html: '<span data-qa="severeScoringNeedsLabel">Severe-scoring areas from the assessment</span>' },
value: { html: '<span data-qa="severeScoringNeedsValue">' + severeScoringNeeds + '</span>' }
},
{
key: { html: '<span data-qa="lowScoringNeedsLabel">Low-scoring areas from the assessment</span>' },
value: { html: '<span data-qa="lowScoringNeedsValue">' + lowScoringNeeds + '</span>'}
key: { html: '<span data-qa="standardScoringNeedsLabel">Standard-scoring areas from the assessment</span>' },
value: { html: '<span data-qa="standardScoringNeedsValue">' + standardScoringNeeds + '</span>'}
},
{
key: { html: '<span data-qa="noScoreNeedsLabel">Areas without a need score</span>' },
Expand Down

0 comments on commit d2c3f8c

Please sign in to comment.