generated from ministryofjustice/hmpps-template-typescript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlearningDifficultiesPage.ts
54 lines (46 loc) · 1.88 KB
/
learningDifficultiesPage.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import { Cas2v2Application as Application } from '@approved-premises/api'
import ApplyPage from '../../applyPage'
import paths from '../../../../../server/paths/apply'
import { pageIsActiveInNavigation } from '../utils'
import { nameOrPlaceholderCopy } from '../../../../../server/utils/utils'
export default class LearningDifficultiesPage extends ApplyPage {
constructor(private readonly application: Application) {
super(
`Learning difficulties and neurodiversity for ${nameOrPlaceholderCopy(application.person)}`,
application,
'health-needs',
'learning-difficulties',
)
pageIsActiveInNavigation('Learning difficulties')
this.pageHasNeurodiversityGuidance()
}
static visit(application: Application): void {
cy.visit(
paths.applications.pages.show({
id: application.id,
task: 'health-needs',
page: 'learning-difficulties',
}),
)
}
pageHasNeurodiversityGuidance = (): void => {
cy.get('.guidance').contains('Neurodiversity covers Autism,')
cy.get('.guidance').contains('This can overlap with learning difficulties')
}
describeAdditionalNeeds = (): void => {
this.checkRadioByNameAndValue('hasLearningNeeds', 'yes')
this.getTextInputByIdAndEnterDetails('needsDetail', 'Has ADHD')
}
describeVulnerability = (): void => {
this.checkRadioByNameAndValue('isVulnerable', 'yes')
this.getTextInputByIdAndEnterDetails('vulnerabilityDetail', 'Medium: is prone to risky behaviour')
}
describeDifficultiesInteracting = (): void => {
this.checkRadioByNameAndValue('hasDifficultyInteracting', 'yes')
this.getTextInputByIdAndEnterDetails('interactionDetail', 'Can be withdrawn')
}
describeAdditionalSupportNeeded = (): void => {
this.checkRadioByNameAndValue('requiresAdditionalSupport', 'yes')
this.getTextInputByIdAndEnterDetails('addSupportDetail', 'Requires daily support')
}
}