@@ -2,17 +2,15 @@ import {CxWrapper} from '../main/wrapper/CxWrapper';
22import { CxCommandOutput } from "../main/wrapper/CxCommandOutput" ;
33import { BaseTest } from "./BaseTest" ;
44import CxResult from '../main/results/CxResult' ;
5- import CxScan from '../main/scan/CxScan' ;
65import { CxConstants } from '../main/wrapper/CxConstants' ;
76
87describe ( "Triage cases" , ( ) => {
98 let cxScanConfig = new BaseTest ( ) ;
109
1110 it ( 'TriageShow Successful case' , async ( ) => {
1211 const auth = new CxWrapper ( cxScanConfig ) ;
13- const scanListOutput = await auth . scanList ( "statuses=Completed" ) ;
14- const scan : CxScan = scanListOutput . payload [ 0 ]
15- const results = await auth . getResultsList ( scan . id )
12+ const scan = ( await auth . scanShow ( cxScanConfig . scanId ) ) . payload . pop ( ) ;
13+ const results = await auth . getResultsList ( cxScanConfig . scanId )
1614 const result : CxResult = results . payload . find ( res => res . type == CxConstants . SAST )
1715
1816 const cxCommandOutput : CxCommandOutput = await auth . triageShow ( scan . projectID , result . similarityId , result . type ) ;
@@ -22,9 +20,8 @@ describe("Triage cases",() => {
2220
2321 it ( 'TriageUpdate Successful case' , async ( ) => {
2422 const auth = new CxWrapper ( cxScanConfig ) ;
25- const scanListOutput = await auth . scanList ( "statuses=Completed" ) ;
26- const scan : CxScan = scanListOutput . payload [ 0 ]
27- const results = await auth . getResultsList ( scan . id )
23+ const scan = ( await auth . scanShow ( cxScanConfig . scanId ) ) . payload . pop ( ) ;
24+ const results = await auth . getResultsList ( cxScanConfig . scanId )
2825 const result : CxResult = results . payload . find ( res => res . type == CxConstants . SAST )
2926
3027 const cxCommandOutput : CxCommandOutput = await auth . triageUpdate ( scan . projectID , result . similarityId , result . type , CxConstants . STATE_CONFIRMED , "Edited via JavascriptWrapper" , result . severity . toLowerCase ( ) == "high" ? CxConstants . SEVERITY_MEDIUM : CxConstants . SEVERITY_HIGH ) ;
0 commit comments