@@ -80,26 +80,36 @@ describe('Incident Tests', () => {
80
80
} ) ;
81
81
} ) ;
82
82
} ) ;
83
-
84
- it ( 'should update an incident provided an existing incident ID' , done => {
83
+ it ( 'should update an incident when someone gets assigned to the incident' , done => {
85
84
sendRequest ( 'post' , incidentsEndpoint , testIncident , ( err , res ) => {
86
- const updateIncidentUrl = '/api/incidents/' + res . body . data . id ;
85
+ const { id } = res . body . data ;
86
+ const updateIncidentUrl = '/api/incidents/' + id ;
87
87
sendRequest (
88
88
'put' ,
89
89
updateIncidentUrl ,
90
- { ...testIncident , statusId : 3 } ,
90
+ {
91
+ ...testIncident ,
92
+ ccd : [
93
+ {
94
+ userId : 'cjl6fecrb11115vf09xly2f65' ,
95
+ incidentId : id ,
96
+ } ,
97
+ ] ,
98
+ assignee : {
99
+ userId : 'cjl6egyei00005dnytqp4a06l' ,
100
+ incidentId : id ,
101
+ } ,
102
+ } ,
91
103
( error , response ) => {
92
- expect ( response . body . data . statusId ) . toEqual ( 3 ) ;
104
+ expect ( response . body . status ) . toEqual ( 'success' ) ;
93
105
done ( ) ;
94
106
}
95
107
) ;
96
108
} ) ;
97
109
} ) ;
98
-
99
- it ( 'should update an incident when someone gets assigned to it' , done => {
110
+ it ( 'should update an incident when someone gets ccd to it' , done => {
100
111
makeServerCall ( assigneeRequestBody , done , 'put' ) ;
101
112
} ) ;
102
-
103
113
it ( 'should update an incident when someone gets ccd to it' , done => {
104
114
makeServerCall ( ccdRequestBody , done , 'put' ) ;
105
115
} ) ;
0 commit comments