@@ -81,9 +81,11 @@ describe("Results cases", () => {
81
81
expect ( cxCommandOutput . payload . length ) . toBeGreaterThan ( 0 ) ;
82
82
} ) ;
83
83
84
+ // The project ID is hardcoded because there is no dynamic way to associate
85
+ // an application with a project through the CLI.
84
86
it ( "Risk Management - Successful case" , async ( ) => {
85
87
const auth = new CxWrapper ( cxScanConfig ) ;
86
- const projectId = await getProjectId ( auth ) ;
88
+ const projectId = "18bcbafc-d20e-424b-9c7e-8f007f340dee"
87
89
88
90
const cxCommandOutput : CxCommandOutput = await auth . riskManagementResults (
89
91
projectId
@@ -94,9 +96,12 @@ describe("Results cases", () => {
94
96
expect ( cxCommandOutput . payload . length ) . toBeGreaterThan ( 0 ) ;
95
97
} ) ;
96
98
99
+
100
+ // The project ID is hardcoded because there is no dynamic way to associate
101
+ // an application with a project through the CLI.
97
102
it ( "Risk Management - With Limit" , async ( ) => {
98
103
const auth = new CxWrapper ( cxScanConfig ) ;
99
- const projectId = await getProjectId ( auth ) ;
104
+ const projectId = "18bcbafc-d20e-424b-9c7e-8f007f340dee"
100
105
const cxCommandOutput : CxCommandOutput = await auth . riskManagementResults (
101
106
projectId ,
102
107
10
@@ -111,18 +116,6 @@ describe("Results cases", () => {
111
116
} ) ;
112
117
} ) ;
113
118
114
- const getProjectId = async ( auth : CxWrapper ) : Promise < string > => {
115
- const scanList : CxCommandOutput = await auth . scanList ( "statuses=Completed" ) ;
116
- if ( ! scanList . payload . length ) {
117
- throw new Error ( "No completed scans found." ) ;
118
- }
119
- const scan = scanList . payload . find ( ( scan ) => scan . projectID ) ;
120
- if ( ! scan ) {
121
- throw new Error ( "No valid projectId found." ) ;
122
- }
123
- return scan . projectID ;
124
- } ;
125
-
126
119
127
120
const fileExists = ( file : string ) => {
128
121
return new Promise ( ( resolve ) => {
0 commit comments