generated from ministryofjustice/hmpps-template-typescript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommunicationAndLanguagePage.ts
37 lines (33 loc) · 1.26 KB
/
communicationAndLanguagePage.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
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 CommunicationAndLanguagePage extends ApplyPage {
constructor(private readonly application: Application) {
super(
`Communication and language needs for ${nameOrPlaceholderCopy(application.person)}`,
application,
'health-needs',
'communication-and-language',
)
pageIsActiveInNavigation('Communication and language')
}
static visit(application: Application): void {
cy.visit(
paths.applications.pages.show({
id: application.id,
task: 'health-needs',
page: 'communication-and-language',
}),
)
}
specifyInterpretationNeeds = (): void => {
this.checkRadioByNameAndValue('requiresInterpreter', 'yes')
this.getTextInputByIdAndEnterDetails('interpretationDetail', 'Welsh')
}
describeSupportNeeded = (): void => {
this.checkRadioByNameAndValue('hasSupportNeeds', 'yes')
this.getTextInputByIdAndEnterDetails('supportDetail', 'Struggles with written comprehension')
}
}