diff --git a/cypress_shared/components/placeContextHeader.ts b/cypress_shared/components/placeContextHeader.ts index 050a22fda..45510dfcf 100644 --- a/cypress_shared/components/placeContextHeader.ts +++ b/cypress_shared/components/placeContextHeader.ts @@ -39,6 +39,7 @@ export default class PlaceContextHeaderComponent extends Component { 'contain', `Accommodation required from: ${DateFormats.isoDateToUIDate(application.arrivalDate, { format: 'short' })}`, ) + cy.root().should('contain', 'Suitable to share: Yes') }) } } diff --git a/cypress_shared/fixtures/summaryData.json b/cypress_shared/fixtures/summaryData.json new file mode 100644 index 000000000..bb0fb5f9e --- /dev/null +++ b/cypress_shared/fixtures/summaryData.json @@ -0,0 +1,4 @@ +{ + "isAbleToShare": true, + "releaseType": "Custody" +} diff --git a/server/testutils/factories/assessment.ts b/server/testutils/factories/assessment.ts index e0b22493a..fcf34a558 100644 --- a/server/testutils/factories/assessment.ts +++ b/server/testutils/factories/assessment.ts @@ -4,6 +4,7 @@ import { faker } from '@faker-js/faker/locale/en_GB' import { Factory } from 'fishery' import type { TemporaryAccommodationAssessment as Assessment } from '@approved-premises/api' +import summaryData from '../../../cypress_shared/fixtures/summaryData.json' import { DateFormats } from '../../utils/dateUtils' import { fakeObject } from '../utils' import applicationFactory from './application' @@ -27,7 +28,7 @@ class AssessmentFactory extends Factory { export default AssessmentFactory.define(() => ({ id: faker.string.uuid(), application: applicationFactory.withReleaseDate().build(), - summaryData: fakeObject(), + summaryData, allocatedToStaffMemberId: faker.string.uuid(), schemaVersion: faker.string.uuid(), outdatedSchema: false, diff --git a/server/views/temporary-accommodation/components/place-context-header/macro.njk b/server/views/temporary-accommodation/components/place-context-header/macro.njk index 486bf4fa7..706c104d0 100644 --- a/server/views/temporary-accommodation/components/place-context-header/macro.njk +++ b/server/views/temporary-accommodation/components/place-context-header/macro.njk @@ -21,6 +21,12 @@ {% if placeContext.assessment.application.arrivalDate %}
Accommodation required from: {{ formatDate(placeContext.assessment.application.arrivalDate, {format: 'short'}) }}
{% endif %} + {% if placeContext.assessment.summaryData.isAbleToShare === true %} +
Suitable to share: Yes
+ {% endif %} + {% if placeContext.assessment.summaryData.isAbleToShare === false %} +
Suitable to share: No
+ {% endif %} View referral summary (opens in new tab)