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