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

MAN-325 update criminogenic headings on risk page #312

Merged
merged 1 commit into from
Feb 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
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
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
Loading