@@ -242,6 +242,54 @@ func TestRunNilResults_Other_AgentsShouldNotShowAnyResults(t *testing.T) {
242242 removeFileBySuffix (t , printer .FormatJSON )
243243}
244244
245+ func TestRunScsResultsShow_Other_AgentShouldShowSCSResults (t * testing.T ) {
246+ clearFlags ()
247+ mock .HasScs = true
248+ mock .ScsScanPartial = false
249+ mock .ScorecardScanned = true
250+ mock .Flag = wrappers.FeatureFlagResponseModel {Name : wrappers .SCSEngineCLIEnabled , Status : true }
251+
252+ execCmdNilAssertion (t , "results" , "show" , "--scan-id" , "SCS_ONLY" , "--report-format" , "json" , "--agent" , params .VisualStudioAgent )
253+ assertTypePresentJSON (t , params .SCSScorecardType , 0 )
254+ assertTypePresentJSON (t , params .SCSSecretDetectionType , 2 )
255+ assertTotalCountJSON (t , 2 )
256+
257+ removeFileBySuffix (t , printer .FormatJSON )
258+ mock .SetScsMockVarsToDefault ()
259+ }
260+
261+ func TestFilterScsResultsByAgent_ShouldIncludeSCSAndSAST (t * testing.T ) {
262+ results := & wrappers.ScanResultsCollection {
263+ Results : []* wrappers.ScanResult {
264+ {Type : params .SCSScorecardType },
265+ {Type : params .ScsType },
266+ {Type : params .SastType },
267+ },
268+ }
269+
270+ filteredResults := filterScsResultsByAgent (results , params .VisualStudioAgent )
271+
272+ hasSCS := false
273+ hasSCSScorecard := false
274+ hasSAST := false
275+
276+ for _ , result := range filteredResults .Results {
277+ switch result .Type {
278+ case params .ScsType :
279+ hasSCS = true
280+ case params .SCSScorecardType :
281+ hasSCSScorecard = true
282+ case params .SastType :
283+ hasSAST = true
284+ }
285+ }
286+
287+ assert .Assert (t , hasSCS , "Expected SCS type to be included for Visual Studio agent" )
288+ assert .Assert (t , ! hasSCSScorecard , "Expected SCSScorecard type to be excluded for Visual Studio agent" )
289+ assert .Assert (t , hasSAST , "Expected SAST type to be excluded for Visual Studio agent" )
290+ assert .Equal (t , len (filteredResults .Results ), 2 , "Expected 2 results (SCS and SAST) after filtering for Visual Studio agent" )
291+ }
292+
245293func TestResultsExitCode_OnCanceledScan_PrintOnlyScanIDAndStatusCanceledToConsole (t * testing.T ) {
246294 model := wrappers.ScanResponseModel {
247295 ID : "fake-scan-id-kics-fail-sast-canceled-id" ,
0 commit comments