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

Placement request page - add blue banner #2271

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
14 changes: 0 additions & 14 deletions integration_tests/pages/match/searchPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import { Cas1SpaceSearchResult, Cas1SpaceSearchResults, PlacementRequestDetail }
import Page from '../page'
import { placementRequestSummaryListForMatching, summaryCardRows } from '../../../server/utils/match'
import paths from '../../../server/paths/match'
import { isFullPerson } from '../../../server/utils/personUtils'
import { DateFormats } from '../../../server/utils/dateUtils'
import { occupancyCriteriaMap } from '../../../server/utils/match/occupancy'

export default class SearchPage extends Page {
Expand All @@ -22,18 +20,6 @@ export default class SearchPage extends Page {
this.shouldShowMatchingDetails(placementRequest)
}

shouldShowKeyPersonDetails(placementRequest: PlacementRequestDetail) {
cy.get('.prisoner-info').within(() => {
const { person } = placementRequest
if (!isFullPerson(person)) throw new Error('test requires a Full Person')

cy.get('span').contains(person.name)
cy.get('span').contains(`CRN: ${person.crn}`)
cy.get('span').contains(`Tier: ${placementRequest?.risks?.tier?.value.level}`)
cy.get('span').contains(`Date of birth: ${DateFormats.isoDateToUIDate(person.dateOfBirth, { format: 'short' })}`)
})
}
aliuk2012 marked this conversation as resolved.
Show resolved Hide resolved

shouldShowMatchingDetails(placementRequest: PlacementRequestDetail) {
cy.get('.govuk-details').within(() => {
this.shouldContainSummaryListItems(placementRequestSummaryListForMatching(placementRequest))
Expand Down
14 changes: 14 additions & 0 deletions integration_tests/pages/page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
Person,
PersonAcctAlert,
PersonStatus,
PlacementRequestDetail,
PrisonCaseNote,
SortOrder,
TimelineEvent,
Expand All @@ -21,6 +22,7 @@ import { sentenceCase } from '../../server/utils/utils'
import { SumbmittedApplicationSummaryCards } from '../../server/utils/applications/submittedApplicationSummaryCards'
import { eventTypeTranslations } from '../../server/utils/applications/utils'
import { oasysSectionsToExclude } from '../../server/utils/oasysImportUtils'
import { isFullPerson } from '../../server/utils/personUtils'

export type PageElement = Cypress.Chainable<JQuery>

Expand Down Expand Up @@ -622,4 +624,16 @@ export default abstract class Page {
clickMenuItem(label: string): void {
cy.get('[aria-label="Primary navigation"] a').contains(label).click()
}

shouldShowKeyPersonDetails(placementRequest: PlacementRequestDetail) {
cy.get('.prisoner-info').within(() => {
const { person } = placementRequest
if (!isFullPerson(person)) throw new Error('test requires a Full Person')

cy.get('span').contains(person.name)
cy.get('span').contains(`CRN: ${person.crn}`)
cy.get('span').contains(`Tier: ${placementRequest?.risks?.tier?.value.level}`)
cy.get('span').contains(`Date of birth: ${DateFormats.isoDateToUIDate(person.dateOfBirth, { format: 'short' })}`)
})
}
}
3 changes: 3 additions & 0 deletions integration_tests/tests/admin/placementRequests.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,9 @@ context('Placement Requests', () => {
// Then I should be taken to the placement request page
let showPage = Page.verifyOnPage(ShowPage, unmatchedPlacementRequest)

// And I should see the Key-person details in the blue banner
showPage.shouldShowKeyPersonDetails(unmatchedPlacementRequest)

// And I should see the information about the placement request
showPage.shouldShowSummary()
showPage.shouldShowMatchingInformationSummary()
Expand Down
6 changes: 6 additions & 0 deletions server/views/admin/placementRequests/show.njk
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,16 @@
{%- from "moj/components/identity-bar/macro.njk" import mojIdentityBar -%}
{% from "govuk/components/notification-banner/macro.njk" import govukNotificationBanner %}

{% from "../../components/keyDetails/macro.njk" import keyDetails %}
{% extends "../../partials/layout.njk" %}

{% set pageTitle = applicationName + " - View Placement Request" %}

{% block header %}
{{ super() }}
{{ keyDetails(MatchUtils.keyDetails(placementRequest)) }}
aliuk2012 marked this conversation as resolved.
Show resolved Hide resolved
{% endblock %}

{% block content %}
{% include "../../_messages.njk" %}

Expand Down
Loading