From ecc622ce881d6abe679f0235b47a9e92674316ff Mon Sep 17 00:00:00 2001 From: Amardeep Chimber Date: Fri, 8 Nov 2024 16:09:35 +0000 Subject: [PATCH] MAN-156 - add release date --- integration_tests/e2e/sentence.cy.ts | 8 ++++++++ server/views/pages/sentence.njk | 4 ++++ wiremock/mappings/X000001-sentence.json | 1 + 3 files changed, 13 insertions(+) diff --git a/integration_tests/e2e/sentence.cy.ts b/integration_tests/e2e/sentence.cy.ts index 1f8eaa01..90c7c6e1 100644 --- a/integration_tests/e2e/sentence.cy.ts +++ b/integration_tests/e2e/sentence.cy.ts @@ -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)) @@ -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', () => { diff --git a/server/views/pages/sentence.njk b/server/views/pages/sentence.njk index dd8efd87..2eb1cd63 100644 --- a/server/views/pages/sentence.njk +++ b/server/views/pages/sentence.njk @@ -287,6 +287,10 @@ key: { text: "Sentence start date" }, value: { html: '' + sentence.order.startDate | dateWithYear | nl2br if sentence.order.startDate else 'No start date details' + '' } }, + { + key: { text: "Date released on licence" }, + value: { html: '' + sentence.order.releaseDate | dateWithYear | nl2br if sentence.order.releaseDate else 'No release date details' + '' } + }, { key: { text: "Sentence expiry date" }, value: { html: '' + sentence.order.endDate | dateWithYear | nl2br if sentence.order.endDate else 'No end date details' + '' } diff --git a/wiremock/mappings/X000001-sentence.json b/wiremock/mappings/X000001-sentence.json index a2a312fc..81191e68 100644 --- a/wiremock/mappings/X000001-sentence.json +++ b/wiremock/mappings/X000001-sentence.json @@ -189,6 +189,7 @@ "description": "12 month community order", "length": 12, "endDate": "2025-01-31", + "releaseDate": "2024-11-01", "startDate": "2024-02-01" }, "requirements": [