@@ -31,14 +31,21 @@ describe("Triage cases", () => {
3131 expect ( cxShow . exitCode ) . toEqual ( 0 ) ;
3232 }
3333
34- const handleTriageUpdate = async ( scan : any , result : CxResult , newState : string , newSeverity : string , newStateId = "" ) => {
34+ const handleTriageUpdate = async ( scan : any , result : CxResult , newState : string , newSeverity : string , newStateId = "" ) => {
3535 const cxUpdate : CxCommandOutput = await auth . triageUpdate (
3636 scan . projectID , result . similarityId , result . type , newState ,
3737 "Edited via JavascriptWrapper" ,
3838 newSeverity , newStateId
3939 ) ;
4040 expect ( cxUpdate . exitCode ) . toEqual ( 0 ) ;
4141 } ;
42+ const handlegetStates = async ( ) => {
43+ const cxCommandOutput : CxCommandOutput = await auth . triageGetStates ( false ) ;
44+ console . log ( "Json object from states successful case: " + JSON . stringify ( cxCommandOutput ) ) ;
45+ expect ( cxCommandOutput . payload . length ) . toBeGreaterThanOrEqual ( 1 ) ;
46+ expect ( cxCommandOutput . exitCode ) . toBe ( 0 ) ;
47+ return cxCommandOutput
48+ } ;
4249
4350 it ( 'Triage Successful case' , async ( ) => {
4451 const { scan, result } = await getScanAndResult ( ) ;
@@ -49,10 +56,7 @@ describe("Triage cases", () => {
4956 it . skip ( 'Triage with custom state Successful case' , async ( ) => {
5057 const { scan, result } = await getScanAndResult ( ) ;
5158
52- const cxCommandOutput : CxCommandOutput = await auth . triageGetStates ( ) ;
53- console . log ( "Json object from states successful case: " + JSON . stringify ( cxCommandOutput ) ) ;
54- expect ( cxCommandOutput . payload . length ) . toBeGreaterThan ( 1 ) ;
55- expect ( cxCommandOutput . exitCode ) . toBe ( 0 ) ;
59+ const cxCommandOutput = await handlegetStates ( ) ;
5660
5761 let customState = cxCommandOutput . payload [ 0 ] . name
5862
@@ -70,10 +74,8 @@ describe("Triage cases", () => {
7074 it . skip ( 'Triage with custom state id Successful case' , async ( ) => {
7175 const { scan, result } = await getScanAndResult ( ) ;
7276
73- const cxCommandOutput : CxCommandOutput = await auth . triageGetStates ( ) ;
74- console . log ( "Json object from states successful case: " + JSON . stringify ( cxCommandOutput ) ) ;
75- expect ( cxCommandOutput . payload . length ) . toBeGreaterThan ( 1 ) ;
76- expect ( cxCommandOutput . exitCode ) . toBe ( 0 ) ;
77+ const cxCommandOutput = await handlegetStates ( ) ;
78+
7779 const allStates = cxCommandOutput . payload ;
7880 let customStateId = allStates [ 0 ] . id
7981 const customStateName = allStates [ 0 ] . name
0 commit comments