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.
Merge pull request #124 from ministryofjustice/CBA-271-risk-structure
Add new risk page structure
- Loading branch information
Showing
80 changed files
with
1,206 additions
and
1,841 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
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
42 changes: 42 additions & 0 deletions
42
integration_tests/pages/apply/risks-and-needs/risk-information/acctDataPage.ts
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,42 @@ | ||
import { Cas2v2Application as Application } from '../../../../../server/@types/shared/models/Cas2v2Application' | ||
import ApplyPage from '../../applyPage' | ||
import paths from '../../../../../server/paths/apply' | ||
|
||
export default class AcctDataPage extends ApplyPage { | ||
constructor(private readonly application: Application) { | ||
super('Add an ACCT entry', application, 'risk-information', 'acct-data') | ||
} | ||
|
||
static visit(application: Application): void { | ||
cy.visit( | ||
paths.applications.pages.show({ | ||
id: application.id, | ||
task: 'risk-information', | ||
page: 'acct-data', | ||
}), | ||
) | ||
} | ||
|
||
addACCTInformation(): void { | ||
this.completeDateInputs('createdDate', '2022-07-15') | ||
this.checkRadioByNameAndValue('isOngoing', 'no') | ||
this.completeDateInputs('closedDate', '2023-07-15') | ||
this.getTextInputByIdAndEnterDetails('referringInstitution', 'HMPPS prison') | ||
this.getTextInputByIdAndEnterDetails('acctDetails', 'some detail') | ||
} | ||
|
||
clickSubmit(): void { | ||
cy.get('button').contains('Save and add ACCT').click() | ||
} | ||
|
||
clickAddAnother(): void { | ||
cy.get('button').contains('Save and add another').click() | ||
} | ||
|
||
assertFormisEmpty(): void { | ||
cy.get('#createdDate-day').should('have.value', '') | ||
cy.get('#isOngoing').should('not.be.checked') | ||
cy.get('#referringInstitution').should('have.value', '') | ||
cy.get('#acctDetails').should('have.value', '') | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
integration_tests/pages/apply/risks-and-needs/risk-information/acctPage.ts
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,35 @@ | ||
import { Cas2v2Application as Application } from '../../../../../server/@types/shared/models/Cas2v2Application' | ||
import ApplyPage from '../../applyPage' | ||
import paths from '../../../../../server/paths/apply' | ||
import { nameOrPlaceholderCopy } from '../../../../../server/utils/utils' | ||
|
||
export default class AcctPage extends ApplyPage { | ||
constructor(private readonly application: Application) { | ||
super( | ||
`${nameOrPlaceholderCopy(application.person, 'The person')}'s ACCT notes`, | ||
application, | ||
'risk-information', | ||
'acct', | ||
) | ||
} | ||
|
||
static visit(application: Application): void { | ||
cy.visit( | ||
paths.applications.pages.show({ | ||
id: application.id, | ||
task: 'risk-information', | ||
page: 'acct', | ||
}), | ||
) | ||
} | ||
|
||
hasListOfAccts(): void { | ||
cy.get('.govuk-summary-card__title').contains('1 February 2012 - 10 October 2013') | ||
cy.get('.govuk-summary-list').contains('HMPPS prison') | ||
cy.get('.govuk-summary-list').should('contain.html', 'ACCT details<br>some more details on another line') | ||
} | ||
|
||
hasNoAccts(): void { | ||
cy.get('.govuk-body').contains('No ACCT notes have been added.') | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
integration_tests/pages/apply/risks-and-needs/risk-information/additionalConcernsPage.ts
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,8 @@ | ||
import { Cas2v2Application as Application } from '@approved-premises/api' | ||
import ApplyPage from '../../applyPage' | ||
|
||
export default class AdditionalConcernsPage extends ApplyPage { | ||
constructor(private readonly application: Application) { | ||
super('Additional concerns', application, 'risk-information', 'additional-concerns') | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
integration_tests/pages/apply/risks-and-needs/risk-information/concernsPage.ts
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,8 @@ | ||
import { Cas2v2Application as Application } from '@approved-premises/api' | ||
import ApplyPage from '../../applyPage' | ||
|
||
export default class ConcernsPage extends ApplyPage { | ||
constructor(private readonly application: Application) { | ||
super('Concerns', application, 'risk-information', 'concerns') | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
integration_tests/pages/apply/risks-and-needs/risk-information/livingInTheCommunityPage.ts
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,8 @@ | ||
import { Cas2v2Application as Application } from '@approved-premises/api' | ||
import ApplyPage from '../../applyPage' | ||
|
||
export default class LivingInTheCommunityPage extends ApplyPage { | ||
constructor(private readonly application: Application) { | ||
super('Living in the community', application, 'risk-information', 'living-in-the-community') | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
integration_tests/pages/apply/risks-and-needs/risk-information/risksToStaffPage.ts
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,8 @@ | ||
import { Cas2v2Application as Application } from '@approved-premises/api' | ||
import ApplyPage from '../../applyPage' | ||
|
||
export default class RisksToStaffPage extends ApplyPage { | ||
constructor(private readonly application: Application) { | ||
super('Risks to staff', application, 'risk-information', 'risks-to-staff') | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
integration_tests/pages/apply/risks-and-needs/risk-information/selfHarmPage.ts
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,8 @@ | ||
import { Cas2v2Application as Application } from '@approved-premises/api' | ||
import ApplyPage from '../../applyPage' | ||
|
||
export default class SelfHarmPage extends ApplyPage { | ||
constructor(private readonly application: Application) { | ||
super('Self harm', application, 'risk-information', 'self-harm') | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
integration_tests/pages/apply/risks-and-needs/risk-information/violenceAndArsonPage.ts
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,8 @@ | ||
import { Cas2v2Application as Application } from '@approved-premises/api' | ||
import ApplyPage from '../../applyPage' | ||
|
||
export default class ViolenceAndArsonPage extends ApplyPage { | ||
constructor(private readonly application: Application) { | ||
super('Violence and arson', application, 'risk-information', 'violence-and-arson') | ||
} | ||
} |
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.