Skip to content

Commit

Permalink
Update result_test.go
Browse files Browse the repository at this point in the history
  • Loading branch information
elchananarb committed Aug 14, 2024
1 parent 7c5bd71 commit 78a1ac1
Showing 1 changed file with 19 additions and 18 deletions.
37 changes: 19 additions & 18 deletions internal/commands/result_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,24 +237,6 @@ func TestRunGetResultsByScanIdJsonFormat(t *testing.T) {
// Remove generated json file
removeFileBySuffix(t, printer.FormatJSON)
}
func createTestScanResultsCollection() *wrappers.ScanResultsCollection {
return &wrappers.ScanResultsCollection{
Results: []*wrappers.ScanResult{
{
Description: "Vulnerability in SomeComponent",
DescriptionHTML: "Description with quotes",
ScanResultData: wrappers.ScanResultData{
Nodes: []*wrappers.ScanResultNode{
{
FullName: "SomeClass<T>",
Name: "Name with "quotes"",
},
},
},
},
},
}
}

func TestDecodeHTMLEntitiesInResults(t *testing.T) {
// Setup: Creating test data with HTML entities
Expand Down Expand Up @@ -346,6 +328,25 @@ func TestRunGetResultsByScanIdSummaryMarkdownFormat(t *testing.T) {
removeFileBySuffix(t, "md")
}

func createTestScanResultsCollection() *wrappers.ScanResultsCollection {
return &wrappers.ScanResultsCollection{
Results: []*wrappers.ScanResult{
{
Description: "Vulnerability in SomeComponent",
DescriptionHTML: "Description with quotes",
ScanResultData: wrappers.ScanResultData{
Nodes: []*wrappers.ScanResultNode{
{
FullName: "SomeClass<T>",
Name: "Name with "quotes"",
},
},
},
},
},
}
}

func removeFileBySuffix(t *testing.T, suffix string) {
removeFile(t, fileName, suffix)
}
Expand Down

0 comments on commit 78a1ac1

Please sign in to comment.