@@ -3,9 +3,8 @@ import { AccessMode } from '../../../support/commands/api'
3
3
4
4
describe ( 'History of Sexually Motivated Offence conditional logic' , ( ) => {
5
5
const destinations = {
6
- landingPage : '/thinking-behaviours-attitudes' ,
7
- sexualOffending : '/thinking-behaviours-attitudes-sexual-offending' ,
8
- thinkingBehaviours : '/thinking-behaviours' ,
6
+ riskOfSexualHarm : '/thinking-behaviours-attitudes-risk-of-sexual-harm' ,
7
+ riskOfSexualHarmDetails : '/thinking-behaviours-attitudes-risk-of-sexual-harm-details' ,
9
8
summary : '/thinking-behaviours-attitudes-summary' ,
10
9
}
11
10
@@ -27,19 +26,19 @@ describe('History of Sexually Motivated Offence conditional logic', () => {
27
26
cy . enterAssessment ( AccessMode . READ_WRITE , { sexuallyMotivatedOffenceHistory : 'YES' } )
28
27
cy . sectionNotMarkedAsComplete ( sectionName )
29
28
cy . assessmentNotMarkedAsComplete ( )
30
- cy . visitSection ( sectionName )
31
- cy . assertStepUrlIs ( destinations . landingPage )
29
+
30
+ cy . visitStep ( destinations . riskOfSexualHarm )
32
31
cy . getQuestion ( question ) . hasHint ( null ) . getRadio ( 'Yes' ) . isChecked ( )
33
32
cy . getQuestion ( question ) . getRadio ( 'No' ) . isDisabled ( )
34
33
cy . saveAndContinue ( )
35
- cy . assertStepUrlIs ( destinations . sexualOffending )
34
+ cy . assertStepUrlIs ( destinations . riskOfSexualHarmDetails )
36
35
} )
37
36
38
37
it ( 'NO from Oasys does not override SAN' , ( ) => {
39
38
cy . enterAssessment ( AccessMode . READ_WRITE , { sexuallyMotivatedOffenceHistory : 'NO' } )
40
39
cy . sectionMarkedAsComplete ( sectionName )
41
40
cy . assessmentMarkedAsComplete ( )
42
- cy . visitStep ( destinations . landingPage )
41
+ cy . visitStep ( destinations . riskOfSexualHarm )
43
42
cy . getQuestion ( question ) . hasHint ( hint ) . getRadio ( 'No' ) . isChecked ( )
44
43
cy . getQuestion ( question ) . getRadio ( 'Yes' ) . isNotDisabled ( )
45
44
} )
@@ -48,7 +47,7 @@ describe('History of Sexually Motivated Offence conditional logic', () => {
48
47
cy . enterAssessment ( AccessMode . READ_WRITE , { sexuallyMotivatedOffenceHistory : null } )
49
48
cy . sectionMarkedAsComplete ( sectionName )
50
49
cy . assessmentMarkedAsComplete ( )
51
- cy . visitStep ( destinations . landingPage )
50
+ cy . visitStep ( destinations . riskOfSexualHarm )
52
51
cy . getQuestion ( question ) . hasHint ( null ) . getRadio ( 'No' ) . isChecked ( )
53
52
cy . getQuestion ( question ) . getRadio ( 'Yes' ) . isNotDisabled ( )
54
53
} )
@@ -58,18 +57,16 @@ describe('History of Sexually Motivated Offence conditional logic', () => {
58
57
before ( ( ) => {
59
58
cy . loadFixture ( Fixture . CompleteAssessment )
60
59
cy . enterAssessment ( )
61
- cy . visitStep ( destinations . landingPage )
60
+ cy . visitStep ( destinations . riskOfSexualHarm )
62
61
cy . getQuestion ( question ) . getRadio ( 'Yes' ) . clickLabel ( )
63
62
cy . saveAndContinue ( )
64
- cy . assertStepUrlIs ( destinations . sexualOffending )
63
+ cy . assertStepUrlIs ( destinations . riskOfSexualHarmDetails )
65
64
cy . getQuestion ( 'Is there evidence Sam shows sexual preoccupation?' ) . getRadio ( 'Unknown' ) . clickLabel ( )
66
65
cy . getQuestion ( 'Is there evidence Sam has offence-related sexual interests?' ) . getRadio ( 'Unknown' ) . clickLabel ( )
67
66
cy . getQuestion ( 'Is there evidence Sam finds it easier to seek emotional intimacy with children over adults?' )
68
67
. getRadio ( 'Unknown' )
69
68
. clickLabel ( )
70
69
cy . saveAndContinue ( )
71
- cy . assertStepUrlIs ( destinations . thinkingBehaviours )
72
- cy . saveAndContinue ( )
73
70
cy . assertStepUrlIs ( destinations . summary )
74
71
cy . get ( '#tab_practitioner-analysis' ) . click ( )
75
72
cy . markAsComplete ( )
@@ -86,7 +83,7 @@ describe('History of Sexually Motivated Offence conditional logic', () => {
86
83
cy . enterAssessment ( AccessMode . READ_WRITE , { sexuallyMotivatedOffenceHistory : 'YES' } )
87
84
cy . sectionMarkedAsComplete ( sectionName )
88
85
cy . assessmentMarkedAsComplete ( )
89
- cy . visitStep ( destinations . landingPage )
86
+ cy . visitStep ( destinations . riskOfSexualHarm )
90
87
cy . getQuestion ( question ) . hasHint ( null ) . getRadio ( 'Yes' ) . isChecked ( )
91
88
cy . getQuestion ( question ) . getRadio ( 'No' ) . isDisabled ( )
92
89
} )
@@ -95,7 +92,7 @@ describe('History of Sexually Motivated Offence conditional logic', () => {
95
92
cy . enterAssessment ( AccessMode . READ_WRITE , { sexuallyMotivatedOffenceHistory : 'NO' } )
96
93
cy . sectionMarkedAsComplete ( sectionName )
97
94
cy . assessmentMarkedAsComplete ( )
98
- cy . visitStep ( destinations . landingPage )
95
+ cy . visitStep ( destinations . riskOfSexualHarm )
99
96
cy . getQuestion ( question ) . hasHint ( hint ) . getRadio ( 'Yes' ) . isChecked ( )
100
97
cy . getQuestion ( question ) . getRadio ( 'No' ) . isNotDisabled ( )
101
98
} )
@@ -104,7 +101,7 @@ describe('History of Sexually Motivated Offence conditional logic', () => {
104
101
cy . enterAssessment ( AccessMode . READ_WRITE , { sexuallyMotivatedOffenceHistory : null } )
105
102
cy . sectionMarkedAsComplete ( sectionName )
106
103
cy . assessmentMarkedAsComplete ( )
107
- cy . visitStep ( destinations . landingPage )
104
+ cy . visitStep ( destinations . riskOfSexualHarm )
108
105
cy . getQuestion ( question ) . hasHint ( null ) . getRadio ( 'Yes' ) . isChecked ( )
109
106
cy . getQuestion ( question ) . getRadio ( 'No' ) . isNotDisabled ( )
110
107
} )
@@ -118,23 +115,23 @@ describe('History of Sexually Motivated Offence conditional logic', () => {
118
115
it ( 'YES from Oasys overrides SAN' , ( ) => {
119
116
cy . enterAssessment ( AccessMode . READ_WRITE , { sexuallyMotivatedOffenceHistory : 'YES' } )
120
117
cy . sectionNotMarkedAsComplete ( sectionName )
121
- cy . visitSection ( sectionName )
118
+ cy . visitStep ( destinations . riskOfSexualHarm )
122
119
cy . getQuestion ( question ) . hasHint ( null ) . getRadio ( 'Yes' ) . isChecked ( )
123
120
cy . getQuestion ( question ) . getRadio ( 'No' ) . isDisabled ( )
124
121
} )
125
122
126
123
it ( 'NO from Oasys does not override SAN' , ( ) => {
127
124
cy . enterAssessment ( AccessMode . READ_WRITE , { sexuallyMotivatedOffenceHistory : 'NO' } )
128
125
cy . sectionNotMarkedAsComplete ( sectionName )
129
- cy . visitSection ( sectionName )
126
+ cy . visitStep ( destinations . riskOfSexualHarm )
130
127
cy . getQuestion ( question ) . hasHint ( hint ) . getRadio ( 'Yes' ) . isNotDisabled ( ) . isNotChecked ( )
131
128
cy . getQuestion ( question ) . getRadio ( 'No' ) . isNotDisabled ( ) . isNotChecked ( )
132
129
} )
133
130
134
131
it ( 'NULL from Oasys does not override SAN' , ( ) => {
135
132
cy . enterAssessment ( AccessMode . READ_WRITE , { sexuallyMotivatedOffenceHistory : null } )
136
133
cy . sectionNotMarkedAsComplete ( sectionName )
137
- cy . visitSection ( sectionName )
134
+ cy . visitStep ( destinations . riskOfSexualHarm )
138
135
cy . getQuestion ( question ) . hasHint ( null ) . getRadio ( 'Yes' ) . isNotDisabled ( ) . isNotChecked ( )
139
136
cy . getQuestion ( question ) . getRadio ( 'No' ) . isNotDisabled ( ) . isNotChecked ( )
140
137
} )
0 commit comments