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

NN-3251: Handle low and medium csra assessments #2206

Merged
merged 2 commits into from
Jul 4, 2022
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
2 changes: 2 additions & 0 deletions backend/controllers/prisonerProfile/prisonerCsraHistory.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { putLastNameFirst, formatName, formatTimestampToDate, sortByDateTime } from '../../utils'

const csraOptions = [
{ value: 'LOW', text: 'Low' },
{ value: 'MED', text: 'Medium' },
{ value: 'STANDARD', text: 'Standard' },
{ value: 'HI', text: 'High' },
]
Expand Down
1 change: 1 addition & 0 deletions backend/shared/csraHelpers.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export const csraTranslations = {
LOW: 'Low',
MED: 'Medium',
STANDARD: 'Standard',
HI: 'High',
}
Expand Down
8 changes: 8 additions & 0 deletions backend/tests/prisonerCsraHistory.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,14 @@ describe('Prisoner CSRA History', () => {
expect(res.render).toHaveBeenCalledWith('prisonerProfile/prisonerCsraHistory.njk', {
breadcrumbPrisonerName: 'Smith, John',
csraOptions: [
{
text: 'Low',
value: 'LOW',
},
{
text: 'Medium',
value: 'MED',
},
{
text: 'Standard',
value: 'STANDARD',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ context('Prisoner CSRA history', () => {
.then(($tableRows) => {
cy.get($tableRows).its('length').should('eq', 2)
expect($tableRows.get(0).innerText).to.contain('10/11/2014\tHigh\tDoncaster\tcomment')
expect($tableRows.get(1).innerText).to.contain('02/06/2011\t\tMoorland\tNot entered')
expect($tableRows.get(1).innerText).to.contain('02/06/2011\tLow\tMoorland\tNot entered')
})
})
})
Expand Down