diff --git a/pkg/k8s/report/report_test.go b/pkg/k8s/report/report_test.go index 0d4cd16d3f..cfca1508a9 100644 --- a/pkg/k8s/report/report_test.go +++ b/pkg/k8s/report/report_test.go @@ -822,8 +822,44 @@ func Test_separateMisconfigReports(t *testing.T) { }, }, - // TODO: add vuln only - // TODO: add secret only + { + name: "Vulnerability Report Only", + k8sReport: Report{ + Resources: []Resource{ + deployOrionWithVulns, + cronjobHelloWithVulns, + }, + }, + scanners: types.Scanners{types.VulnerabilityScanner}, + expectedReports: []Report{ + // the order matter for the test + { + Resources: []Resource{ + {Kind: "Deploy"}, + {Kind: "Cronjob"}, + }, + }, + {Resources: []Resource{}}, + }, + }, + { + name: "Secret Report Only", + k8sReport: Report{ + Resources: []Resource{ + deployLuaWithSecrets, + }, + }, + scanners: types.Scanners{types.SecretScanner}, + expectedReports: []Report{ + // the order matter for the test + { + Resources: []Resource{ + {Kind: "Deploy"}, + }, + }, + {Resources: []Resource{}}, + }, + }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) {