Skip to content

Commit

Permalink
improve test
Browse files Browse the repository at this point in the history
Signed-off-by: Austin Abro <[email protected]>
  • Loading branch information
AustinAbro321 committed Jul 23, 2024
1 parent 46c1735 commit 768dcb8
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/pkg/lint/lint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func TestFillComponentTemplate(t *testing.T) {

findings, err := fillComponentTemplate(&component, createOpts)
require.NoError(t, err)
expected := []PackageFinding{
expectedFindings := []PackageFinding{
{
Severity: SevWarn,
Description: "There are templates that are not set and won't be evaluated during lint",
Expand All @@ -59,7 +59,13 @@ func TestFillComponentTemplate(t *testing.T) {
Description: fmt.Sprintf(lang.PkgValidateTemplateDeprecation, "KEY2", "KEY2", "KEY2"),
},
}
require.ElementsMatch(t, expected, findings)

// Add assertions for the expected behavior of fillComponentTemplate
expectedComponent := types.ZarfComponent{
Images: []string{
"value1",
"value2",
fmt.Sprintf("%s%s###", types.ZarfPackageTemplatePrefix, "KEY3"),
},
}
require.ElementsMatch(t, expectedFindings, findings)
require.Equal(t, expectedComponent, component)
}

0 comments on commit 768dcb8

Please sign in to comment.