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-156 - add release date #204

Merged
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
8 changes: 8 additions & 0 deletions integration_tests/e2e/sentence.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ context('Sentence', () => {
page.getRowData('sentence', 'orderStartDate', 'Value').should('contain.text', '19 March 2024')
page.getRowData('sentence', 'orderEndDate', 'Value').should('contain.text', '19 March 2025')

page
.getCardHeader('sentence')
.within(() => cy.get('.govuk-summary-list__value').eq(2).should('contain.text', 'No release date details'))

page
.getRowData('sentence', 'courtDocuments', 'Value')
.within(() => cy.get('ul > li').its('length').should('equal', 3))
Expand Down Expand Up @@ -140,6 +144,10 @@ context('Sentence', () => {
page
.getCardHeader('conviction')
.within(() => cy.get('.govuk-summary-list__value').eq(2).should('contain.text', 'No conviction date'))

page
.getCardHeader('sentence')
.within(() => cy.get('.govuk-summary-list__value').eq(2).should('contain.text', '1 November 2024'))
})

it('Sentence page is rendered with probation history information', () => {
Expand Down
4 changes: 4 additions & 0 deletions server/views/pages/sentence.njk
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,10 @@
key: { text: "Sentence start date" },
value: { html: '<span data-qa="orderStartDateValue">' + sentence.order.startDate | dateWithYear | nl2br if sentence.order.startDate else 'No start date details' + '</span>' }
},
{
key: { text: "Date released on licence" },
value: { html: '<span data-qa="orderStartDateValue">' + sentence.order.releaseDate | dateWithYear | nl2br if sentence.order.releaseDate else 'No release date details' + '</span>' }
},
{
key: { text: "Sentence expiry date" },
value: { html: '<span data-qa="orderEndDateValue">' + sentence.order.endDate | dateWithYear | nl2br if sentence.order.endDate else 'No end date details' + '</span>' }
Expand Down
1 change: 1 addition & 0 deletions wiremock/mappings/X000001-sentence.json
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@
"description": "12 month community order",
"length": 12,
"endDate": "2025-01-31",
"releaseDate": "2024-11-01",
"startDate": "2024-02-01"
},
"requirements": [
Expand Down