Skip to content

Commit 55c705e

Browse files
assert when scan summary api called
1 parent 7b583db commit 55c705e

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

test/integration/result_test.go

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -786,9 +786,8 @@ func TestCreateScan_WithTypeAisc_ConsoleSummaryContainsAISCOutput(t *testing.T)
786786
"scan", "create",
787787
flag(params.ProjectName), getProjectNameForScanTests(),
788788
flag(params.SourcesFlag), Zip,
789-
flag(params.ScanTypes), params.AiscType,
790789
flag(params.BranchFlag), "main",
791-
flag(params.ScanInfoFormatFlag), printer.FormatJSON,
790+
flag(params.ScanInfoFormatFlag), printer.FormatJSON, flag(params.DebugFlag),
792791
}
793792
scanID, _ := executeCreateScan(t, createArgs)
794793
assert.Assert(t, scanID != "", "Scan ID should not be empty")
@@ -813,10 +812,13 @@ func TestCreateScan_WithTypeAisc_ConsoleSummaryContainsAISCOutput(t *testing.T)
813812
assert.NilError(t, copyErr, "Failed to read captured stdout")
814813

815814
output := buf.String()
816-
assert.Assert(t, strings.Contains(output, "AI SUPPLY CHAIN ENGINE SUMMARY"),
817-
"Console output should contain AISC summary header")
818-
assert.Assert(t, strings.Contains(output, "Total Assets"),
819-
"Console output should contain Total Assets row")
820-
assert.Assert(t, strings.Contains(output, "Total Asset Types"),
821-
"Console output should contain Total Asset Types row")
815+
// Check if scan-summary API was called
816+
if strings.Contains(output, "scan-summary") {
817+
assert.Assert(t, strings.Contains(output, "AI SUPPLY CHAIN ENGINE SUMMARY"),
818+
"Console output should contain AISC summary header")
819+
assert.Assert(t, strings.Contains(output, "Total Assets"),
820+
"Console output should contain Total Assets row")
821+
assert.Assert(t, strings.Contains(output, "Total Asset Types"),
822+
"Console output should contain Total Asset Types row")
823+
}
822824
}

0 commit comments

Comments
 (0)