@@ -63,7 +63,51 @@ describe("Results cases",() => {
6363 const cxCommandOutput : CxCommandOutput = await auth . codeBashingList ( "79" , "PHP" , "Reflected XSS All Clients" ) ;
6464 expect ( cxCommandOutput . payload . length ) . toBeGreaterThan ( 0 ) ;
6565 } ) ;
66- } ) ;
66+
67+ // The project ID is hardcoded because there is no dynamic way to associate
68+ // an application with a project through the CLI.
69+ // link to the our application: https://deu.ast.checkmarx.net/applications/5dff8d1c-d27f-4910-afc1-0b9df02324b4/overview
70+ it ( "Risk Management - Successful case" , async ( ) => {
71+ const auth = new CxWrapper ( cxScanConfig ) ;
72+ const projectId = "a5d99fa4-973d-48b5-86c7-6401487e1d52"
73+
74+ const cxCommandOutput : CxCommandOutput = await auth . riskManagementResults (
75+ projectId
76+ ) ;
77+
78+ const str = JSON . stringify ( cxCommandOutput ) ;
79+ console . log ( "Risk Management Result 1: " + str ) ;
80+ console . log ( "Risk Management Exit code 1: " + cxCommandOutput . exitCode ) ;
81+ console . log ( "Risk Management payload 1: " + cxCommandOutput . payload ) ;
82+
83+ expect ( cxCommandOutput . exitCode ) . toBe ( 0 ) ;
84+ expect ( Object . keys ( cxCommandOutput . payload ) . length ) . toBeGreaterThan ( 0 ) ;
85+ } ) ;
86+
87+
88+ // The project ID is hardcoded because there is no dynamic way to associate
89+ // an application with a project through the CLI.
90+ // link to the our application: https://deu.ast.checkmarx.net/applications/5dff8d1c-d27f-4910-afc1-0b9df02324b4/overview
91+ it ( "Risk Management - With Limit" , async ( ) => {
92+ const auth = new CxWrapper ( cxScanConfig ) ;
93+ const projectId = "a5d99fa4-973d-48b5-86c7-6401487e1d52"
94+ const cxCommandOutput : CxCommandOutput = await auth . riskManagementResults (
95+ projectId ,
96+ 10
97+ ) ;
98+
99+ const str = JSON . stringify ( cxCommandOutput ) ;
100+ console . log ( "Risk Management Result 2: " + str ) ;
101+ console . log ( "Risk Management Exit code 2: " + cxCommandOutput . exitCode ) ;
102+ console . log ( "Risk Management payload 2: " + cxCommandOutput . payload ) ;
103+
104+ expect ( cxCommandOutput . exitCode ) . toBe ( 0 ) ;
105+ expect ( Object . keys ( cxCommandOutput . payload ) . length ) . toBeGreaterThan ( 0 ) ;
106+ } ) ;
107+
108+ } )
109+
110+
67111
68112const fileExists = ( file :string ) => {
69113 return new Promise ( ( resolve ) => {
0 commit comments