generated from ministryofjustice/hmpps-template-typescript
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MAN-363 add description and outcome values activity details page
- Loading branch information
1 parent
d2c3f8c
commit 1f53fd3
Showing
7 changed files
with
163 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
import Page from '../pages/page' | ||
import ActivityLogDetailsPage from '../pages/activityLogDetails' | ||
|
||
context('Activity log details', () => { | ||
it('should render a complied appointment', () => { | ||
cy.visit('/case/X000001/activity-log/activity/15') | ||
const page = new ActivityLogDetailsPage() | ||
page.setPageTitle('Office appointment with Terry Jones') | ||
cy.get('[data-qa="appointmentType"]').should('contain.text', 'National standard appointment') | ||
cy.get('[data-qa="complianceTag"]').should('contain.text', 'Complied') | ||
page.getCardHeader('appointmentDetails').should('contain.text', 'Appointment details') | ||
page | ||
.getCardElement('appointmentDetails', '.govuk-summary-list__key', 0) | ||
.should('contain.text', 'Type of appointment') | ||
page.getCardElement('appointmentDetails', '.govuk-summary-list__value', 0).should('contain.text', 'Previous') | ||
page.getCardElement('appointmentDetails', '.govuk-summary-list__key', 1).should('contain.text', 'Description') | ||
page | ||
.getCardElement('appointmentDetails', '.govuk-summary-list__value', 1) | ||
.should('contain.text', 'User-generated free text content') | ||
page.getCardElement('appointmentDetails', '.govuk-summary-list__key', 2).should('contain.text', 'Date') | ||
page.getCardElement('appointmentDetails', '.govuk-summary-list__value', 2).should('contain.text', 'Friday 22 March') | ||
page.getCardElement('appointmentDetails', '.govuk-summary-list__key', 3).should('contain.text', 'Time') | ||
page | ||
.getCardElement('appointmentDetails', '.govuk-summary-list__value', 3) | ||
.should('contain.text', '10:15am to 10:30am') | ||
|
||
page.getCardHeader('outcomeDetails').should('contain.text', 'Outcome details') | ||
page.getCardElement('outcomeDetails', '.govuk-summary-list__key', 0).should('contain.text', 'Complied') | ||
page.getCardElement('outcomeDetails', '.govuk-summary-list__value', 0).should('contain.text', 'Yes') | ||
page.getCardElement('outcomeDetails', '.govuk-summary-list__actions a', 0).should('contain.text', 'Change') | ||
page | ||
.getCardElement('outcomeDetails', '.govuk-summary-list__actions', 0) | ||
.find('a') | ||
.should('have.attr', 'href', '/case/X000001/handoff/delius') | ||
page.getCardElement('outcomeDetails', '.govuk-summary-list__key', 1).should('contain.text', 'Outcome') | ||
page | ||
.getCardElement('outcomeDetails', '.govuk-summary-list__value', 1) | ||
.should('contain.text', 'User-generated free text content') | ||
page.getCardElement('outcomeDetails', '.govuk-summary-list__key', 2).should('contain.text', 'RAR activity') | ||
page.getCardElement('outcomeDetails', '.govuk-summary-list__value', 2).should('contain.text', 'No') | ||
page.getCardElement('outcomeDetails', '.govuk-summary-list__key', 3).should('contain.text', 'Sensitive') | ||
page.getCardElement('outcomeDetails', '.govuk-summary-list__value', 3).should('contain.text', 'No') | ||
page.getCardElement('outcomeDetails', '.govuk-summary-list__key', 4).should('contain.text', 'Notes') | ||
page | ||
.getCardElement('outcomeDetails', '.govuk-summary-list__value', 4) | ||
.should('contain.text', 'Turned up and was very apologetic') | ||
|
||
cy.get('[data-qa="appointmentLastUpdated"]').should('contain.text', 'Last updated by Paul Smith on 20 Mar 2023') | ||
}) | ||
it('should render an appointment without an outcome', () => { | ||
cy.visit('/case/X000001/activity-log/activity/16') | ||
const page = new ActivityLogDetailsPage() | ||
page.setPageTitle('Office appointment with Terry Jones') | ||
cy.get('[data-qa="appointmentType"]').should('contain.text', 'National standard appointment') | ||
cy.get('.note-panel').find('.govuk-warning-text__text').should('contain.text', 'Outcome not recorded') | ||
cy.get('.note-panel') | ||
.find('a') | ||
.should('contain.text', 'Record an outcome') | ||
.should('have.attr', 'href', '/case/X000001/handoff/delius') | ||
page.getCardHeader('appointmentDetails').should('contain.text', 'Appointment details') | ||
page | ||
.getCardElement('appointmentDetails', '.govuk-summary-list__key', 0) | ||
.should('contain.text', 'Type of appointment') | ||
page.getCardElement('appointmentDetails', '.govuk-summary-list__value', 0).should('contain.text', 'Previous') | ||
page.getCardElement('appointmentDetails', '.govuk-summary-list__key', 1).should('contain.text', 'Date') | ||
page | ||
.getCardElement('appointmentDetails', '.govuk-summary-list__value', 1) | ||
.should('contain.text', 'Wednesday 21 February') | ||
page.getCardElement('appointmentDetails', '.govuk-summary-list__key', 2).should('contain.text', 'Time') | ||
page | ||
.getCardElement('appointmentDetails', '.govuk-summary-list__value', 2) | ||
.should('contain.text', '10:15am to 10:30am') | ||
page.getCardElement('appointmentDetails', '.govuk-summary-list__key', 3).should('contain.text', 'RAR activity') | ||
page.getCardElement('appointmentDetails', '.govuk-summary-list__value', 3).should('contain.text', 'Not known') | ||
page.getCardElement('appointmentDetails', '.govuk-summary-list__key', 4).should('contain.text', 'Appointment notes') | ||
page.getCardElement('appointmentDetails', '.govuk-summary-list__value', 4).should('contain.text', 'Some notes') | ||
page.getCardElement('appointmentDetails', '.govuk-summary-list__key', 5).should('contain.text', 'Sensitive') | ||
page.getCardElement('appointmentDetails', '.govuk-summary-list__value', 5).should('contain.text', 'No') | ||
page.getCardHeader('outcomeDetails').should('not.exist') | ||
}) | ||
it('should render a non complied appointment', () => { | ||
cy.visit('/case/X000001/activity-log/activity/13') | ||
const page = new ActivityLogDetailsPage() | ||
page.setPageTitle('Video call with Paulie Walnuts') | ||
cy.get('[data-qa="complianceTag"]').should('contain.text', 'Unacceptable absence') | ||
cy.get('.note-panel').find('.govuk-warning-text__text').should('contain.text', 'Absent and waiting for evidence') | ||
cy.get('.note-panel') | ||
.find('a') | ||
.should('contain.text', 'Change outcome') | ||
.should('have.attr', 'href', '/change-outcome/X000001/13') | ||
page.getCardHeader('appointmentDetails').should('contain.text', 'Appointment details') | ||
page | ||
.getCardElement('appointmentDetails', '.govuk-summary-list__key', 0) | ||
.should('contain.text', 'Type of appointment') | ||
page.getCardElement('appointmentDetails', '.govuk-summary-list__value', 0).should('contain.text', 'Previous') | ||
page.getCardElement('appointmentDetails', '.govuk-summary-list__key', 1).should('contain.text', 'Description') | ||
page | ||
.getCardElement('appointmentDetails', '.govuk-summary-list__value', 1) | ||
.should('contain.text', 'User-generated free text content') | ||
page.getCardElement('appointmentDetails', '.govuk-summary-list__key', 2).should('contain.text', 'Date') | ||
page | ||
.getCardElement('appointmentDetails', '.govuk-summary-list__value', 2) | ||
.should('contain.text', 'Sunday 12 February') | ||
page.getCardElement('appointmentDetails', '.govuk-summary-list__key', 3).should('contain.text', 'Time') | ||
page | ||
.getCardElement('appointmentDetails', '.govuk-summary-list__value', 3) | ||
.should('contain.text', '10:15am to 10:30am') | ||
|
||
page.getCardHeader('outcomeDetails').should('contain.text', 'Outcome details') | ||
page.getCardElement('outcomeDetails', '.govuk-summary-list__key', 0).should('contain.text', 'Complied') | ||
page | ||
.getCardElement('outcomeDetails', '.govuk-summary-list__value', 0) | ||
.should('contain.text', 'Unacceptable absence') | ||
page.getCardElement('outcomeDetails', '.govuk-summary-list__actions a', 0).should('contain.text', 'Change') | ||
page | ||
.getCardElement('outcomeDetails', '.govuk-summary-list__actions', 0) | ||
.find('a') | ||
.should('have.attr', 'href', '/case/X000001/handoff/delius') | ||
page.getCardElement('outcomeDetails', '.govuk-summary-list__key', 1).should('contain.text', 'Outcome') | ||
page | ||
.getCardElement('outcomeDetails', '.govuk-summary-list__value', 1) | ||
.should('contain.text', 'User-generated free text content') | ||
page.getCardElement('outcomeDetails', '.govuk-summary-list__key', 2).should('contain.text', 'Sensitive') | ||
page.getCardElement('outcomeDetails', '.govuk-summary-list__value', 2).should('contain.text', 'No') | ||
page.getCardElement('outcomeDetails', '.govuk-summary-list__key', 3).should('contain.text', 'Notes') | ||
page | ||
.getCardElement('outcomeDetails', '.govuk-summary-list__value', 3) | ||
.should('contain.text', 'Stuart did not attend this appointment') | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import Page, { PageElement } from './page' | ||
|
||
export default class ActivityLogDetailsPage extends Page {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters