Skip to content

Commit

Permalink
Render accommodation sharing in tracking banner
Browse files Browse the repository at this point in the history
This commit adds the sharing suitability information to the tracking
banner if it's available.

As we're accessing this data from a free object with no type safety, we
explicitly check for `true` or `false`. If this data is not present, the
conditional will return falsey and not render the section.
  • Loading branch information
libuk committed Sep 20, 2023
1 parent 80fb541 commit 61da7f5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions cypress_shared/components/placeContextHeader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')
})
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@
{% if placeContext.assessment.application.arrivalDate %}
<div>Accommodation required from: {{ formatDate(placeContext.assessment.application.arrivalDate, {format: 'short'}) }}</div>
{% endif %}
{% if placeContext.assessment.summaryData.isAbleToShare === true %}
<div>Suitable to share: Yes</div>
{% endif %}
{% if placeContext.assessment.summaryData.isAbleToShare === false %}
<div>Suitable to share: No</div>
{% endif %}
</div>
<a class="govuk-link" href="{{ addPlaceContext(paths.assessments.summary({ id: placeContext.assessment.id })) }}" rel="noreferrer noopener" target="_blank">View referral summary (opens in new tab)</a>
</div>
Expand Down

0 comments on commit 61da7f5

Please sign in to comment.