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-36 requirement note ui changes and int tests completed
- Loading branch information
1 parent
82e07c5
commit 51f9da9
Showing
27 changed files
with
381 additions
and
27 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
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,38 @@ | ||
import Page from '../pages/page' | ||
import SentencePage from '../pages/sentence' | ||
|
||
context('Sentence', () => { | ||
it('Requirement note page is rendered', () => { | ||
cy.visit('/case/X000001/sentence/requirement/F/note/0') | ||
const page = Page.verifyOnPage(SentencePage) | ||
page.headerCrn().should('contain.text', 'X000001') | ||
page.headerName().should('contain.text', 'Caroline Wolff') | ||
cy.get('[data-qa=pageHeading]').eq(0).should('contain.text', 'Sentence') | ||
|
||
cy.get(`[class=app-summary-card__header]`).within(() => | ||
cy.get('h2').should('contain.text', '1 of 12 RAR days completed'), | ||
) | ||
|
||
cy.get(`[class=app-summary-card__body]`).within(() => cy.get('dt').should('have.length', 6)) | ||
|
||
cy.get(`[class=app-summary-card__body]`).within(() => cy.get('dd').should('have.length', 6)) | ||
|
||
cy.get(`[class=app-summary-card__body]`).within(() => cy.get('dt').eq(0).should('contain.text', 'Length of RAR')) | ||
cy.get(`[class=app-summary-card__body]`).within(() => cy.get('dd').eq(0).should('contain.text', '12 days')) | ||
|
||
cy.get(`[class=app-summary-card__body]`).within(() => cy.get('dt').eq(1).should('contain.text', 'Completed RAR')) | ||
cy.get(`[class=app-summary-card__body]`).within(() => cy.get('dd').eq(1).should('contain.text', '1 day')) | ||
|
||
cy.get(`[class=app-summary-card__body]`).within(() => cy.get('dt').eq(2).should('contain.text', 'Start date')) | ||
cy.get(`[class=app-summary-card__body]`).within(() => cy.get('dd').eq(2).should('contain.text', '12 April 2024')) | ||
|
||
cy.get(`[class=app-summary-card__body]`).within(() => cy.get('dt').eq(3).should('contain.text', 'Note added by')) | ||
cy.get(`[class=app-summary-card__body]`).within(() => cy.get('dd').eq(3).should('contain.text', 'Jon Jones')) | ||
|
||
cy.get(`[class=app-summary-card__body]`).within(() => cy.get('dt').eq(4).should('contain.text', 'Date added')) | ||
cy.get(`[class=app-summary-card__body]`).within(() => cy.get('dd').eq(4).should('contain.text', '21 August 2024')) | ||
|
||
cy.get(`[class=app-summary-card__body]`).within(() => cy.get('dt').eq(5).should('contain.text', 'Note')) | ||
cy.get(`[class=app-summary-card__body]`).within(() => cy.get('dd').eq(5).should('contain.text', '123456')) | ||
}) | ||
}) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,17 @@ | ||
import Page from './page' | ||
import Page, { PageElement } from './page' | ||
|
||
export default class SentencePage extends Page { | ||
constructor() { | ||
super('Sentence') | ||
} | ||
|
||
getRequirementLabel = (requirementIndex: number, index: number): PageElement => | ||
cy.get( | ||
`[data-qa="requirementsValue"] details:nth-of-type(${requirementIndex}) .govuk-summary-list__row:nth-of-type(${index}) dt`, | ||
) | ||
|
||
getRequirementValue = (requirementIndex: number, index: number): PageElement => | ||
cy.get( | ||
`[data-qa="requirementsValue"] details:nth-of-type(${requirementIndex}) .govuk-summary-list__row:nth-of-type(${index}) dd`, | ||
) | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { PersonSummary } from './common' | ||
|
||
export interface RequirementNoteDetails { | ||
personSummary: PersonSummary | ||
requirement: Requirement | ||
} | ||
|
||
export interface Requirement { | ||
code: string | ||
expectedStartDate?: string | ||
actualStartDate: string | ||
expectedEndDate?: string | ||
actualEndDate?: string | ||
terminationReason?: string | ||
description: string | ||
length: number | ||
lengthUnitValue: string | ||
requirementNote: RequirementNote | ||
rar?: { | ||
completed: number | ||
scheduled: number | ||
totalDays: number | ||
} | ||
} | ||
|
||
export interface RequirementNote { | ||
id: string | ||
createdBy: string | ||
createdByDate: string | ||
note: string | ||
hasNotesBeenTruncated: boolean | ||
} |
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
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
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
Oops, something went wrong.