generated from ministryofjustice/hmpps-template-typescript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathotherHealthPage.ts
42 lines (37 loc) · 1.36 KB
/
otherHealthPage.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
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 OtherHealthPage extends ApplyPage {
constructor(private readonly application: Application) {
super(
`Other health needs for ${nameOrPlaceholderCopy(application.person)}`,
application,
'health-needs',
'other-health',
)
pageIsActiveInNavigation('Other health')
}
static visit(application: Application): void {
cy.visit(
paths.applications.pages.show({
id: application.id,
task: 'health-needs',
page: 'other-health',
}),
)
}
describeLongTermHealthConditions = (): void => {
this.checkRadioByNameAndValue('hasLongTermHealthCondition', 'yes')
this.getTextInputByIdAndEnterDetails('healthConditionDetail', 'Chronic arthritis')
this.checkRadioByNameAndValue('hasHadStroke', 'no')
}
describeSeizures = (): void => {
this.checkRadioByNameAndValue('hasSeizures', 'yes')
this.getTextInputByIdAndEnterDetails('seizuresDetail', 'Epilepsy: controlled by meds')
}
confirmCancerTreatment = (): void => {
this.checkRadioByNameAndValue('beingTreatedForCancer', 'no')
}
}