@@ -70,6 +70,40 @@ describe("Triage cases", () => {
7070 await handleTriageSCAUpdate ( projectId , vulnerabilities , scanType , state , comment ) ;
7171 } ) ;
7272
73+ it ( 'SCA Triage Show and Update Failure case' , async ( ) => {
74+ const projectId = "invalid-project-id" ;
75+ const vulnerabilities = "invalid-vulnerability-string" ;
76+ const scanType = "invalid" ;
77+ const state = "invalid_state" ;
78+ const comment = "invalid_comment" ;
79+
80+ const cxShow : CxCommandOutput = await auth . triageSCAShow ( projectId , vulnerabilities , scanType ) ;
81+ expect ( cxShow . exitCode ) . not . toEqual ( 0 ) ;
82+
83+ const cxUpdate : CxCommandOutput = await auth . triageSCAUpdate ( projectId , vulnerabilities , scanType , state , comment ) ;
84+ expect ( cxUpdate . exitCode ) . not . toEqual ( 0 ) ;
85+ } ) ;
86+
87+ it ( 'SCA Triage Show and Update with empty vulnerabilities' , async ( ) => {
88+ const projectId = "d4d7f382-8dee-48c7-ac8f-67fab2c313a8" ;
89+ const vulnerabilities = "" ;
90+ const scanType = "sca" ;
91+ const state = "To_verify" ;
92+ const comment = "comment1" ;
93+ const cxShow : CxCommandOutput = await auth . triageSCAShow ( projectId , vulnerabilities , scanType ) ;
94+ expect ( cxShow . exitCode ) . not . toEqual ( 0 ) ;
95+
96+ const cxUpdate : CxCommandOutput = await auth . triageSCAUpdate ( projectId , vulnerabilities , scanType , state , comment ) ;
97+ expect ( cxUpdate . exitCode ) . not . toEqual ( 0 ) ;
98+ } ) ;
99+
100+ it ( 'SCA Triage Show and Update with null/undefined arguments' , async ( ) => {
101+ const cxShow : CxCommandOutput = await auth . triageSCAShow ( undefined , undefined , undefined ) ;
102+ expect ( cxShow . exitCode ) . not . toEqual ( 0 ) ;
103+ const cxUpdate : CxCommandOutput = await auth . triageSCAUpdate ( undefined , undefined , undefined , undefined , undefined ) ;
104+ expect ( cxUpdate . exitCode ) . not . toEqual ( 0 ) ;
105+ } ) ;
106+
73107 it ( 'Triage Successful case' , async ( ) => {
74108 const { scan, result } = await getScanAndResult ( ) ;
75109 await handleTriageShow ( scan , result ) ;
0 commit comments