44 * you may not use this file except in compliance with the Elastic License.
55 */
66
7- import { ConnectorTypes , CasesPatchRequest } from '../../../common/api' ;
7+ import { ConnectorTypes , CasesPatchRequest , CaseStatuses } from '../../../common/api' ;
88import {
99 createMockSavedObjectsRepository ,
1010 mockCaseNoConnectorId ,
@@ -27,7 +27,7 @@ describe('update', () => {
2727 cases : [
2828 {
2929 id : 'mock-id-1' ,
30- status : ' closed' as const ,
30+ status : CaseStatuses . closed ,
3131 version : 'WzAsMV0=' ,
3232 } ,
3333 ] ,
@@ -56,7 +56,7 @@ describe('update', () => {
5656 description : 'This is a brand new case of a bad meanie defacing data' ,
5757 id : 'mock-id-1' ,
5858 external_service : null ,
59- status : ' closed' ,
59+ status : CaseStatuses . closed ,
6060 tags : [ 'defacement' ] ,
6161 title : 'Super Bad Security Issue' ,
6262 totalComment : 0 ,
@@ -79,8 +79,8 @@ describe('update', () => {
7979 username : 'awesome' ,
8080 } ,
8181 action_field : [ 'status' ] ,
82- new_value : ' closed' ,
83- old_value : ' open' ,
82+ new_value : CaseStatuses . closed ,
83+ old_value : CaseStatuses . open ,
8484 } ,
8585 references : [
8686 {
@@ -98,15 +98,18 @@ describe('update', () => {
9898 cases : [
9999 {
100100 id : 'mock-id-1' ,
101- status : ' open' as const ,
101+ status : CaseStatuses . open ,
102102 version : 'WzAsMV0=' ,
103103 } ,
104104 ] ,
105105 } ;
106106
107107 const savedObjectsClient = createMockSavedObjectsRepository ( {
108108 caseSavedObject : [
109- { ...mockCases [ 0 ] , attributes : { ...mockCases [ 0 ] . attributes , status : 'closed' } } ,
109+ {
110+ ...mockCases [ 0 ] ,
111+ attributes : { ...mockCases [ 0 ] . attributes , status : CaseStatuses . closed } ,
112+ } ,
110113 ...mockCases . slice ( 1 ) ,
111114 ] ,
112115 } ) ;
@@ -130,7 +133,7 @@ describe('update', () => {
130133 description : 'This is a brand new case of a bad meanie defacing data' ,
131134 id : 'mock-id-1' ,
132135 external_service : null ,
133- status : ' open' ,
136+ status : CaseStatuses . open ,
134137 tags : [ 'defacement' ] ,
135138 title : 'Super Bad Security Issue' ,
136139 totalComment : 0 ,
@@ -146,7 +149,7 @@ describe('update', () => {
146149 cases : [
147150 {
148151 id : 'mock-no-connector_id' ,
149- status : ' closed' as const ,
152+ status : CaseStatuses . closed ,
150153 version : 'WzAsMV0=' ,
151154 } ,
152155 ] ,
@@ -177,7 +180,7 @@ describe('update', () => {
177180 description : 'This is a brand new case of a bad meanie defacing data' ,
178181 external_service : null ,
179182 title : 'Super Bad Security Issue' ,
180- status : ' closed' ,
183+ status : CaseStatuses . closed ,
181184 tags : [ 'defacement' ] ,
182185 updated_at : '2019-11-25T21:54:48.952Z' ,
183186 updated_by :
{ email :
'[email protected] ' , full_name :
'Awesome D00d' , username :
'awesome' } , @@ -231,7 +234,7 @@ describe('update', () => {
231234 description : 'Oh no, a bad meanie going LOLBins all over the place!' ,
232235 external_service : null ,
233236 title : 'Another bad one' ,
234- status : ' open' ,
237+ status : CaseStatuses . open ,
235238 tags : [ 'LOLBins' ] ,
236239 updated_at : '2019-11-25T21:54:48.952Z' ,
237240 updated_by : {
@@ -314,7 +317,7 @@ describe('update', () => {
314317 cases : [
315318 {
316319 id : 'mock-id-1' ,
317- status : ' open' as const ,
320+ status : CaseStatuses . open ,
318321 version : 'WzAsMV0=' ,
319322 } ,
320323 ] ,
0 commit comments