mirror of
https://github.com/ivuorinen/gh-action-readme.git
synced 2026-03-12 08:00:06 +00:00
Initial commit
This commit is contained in:
24
internal/internal_defaults_test.go
Normal file
24
internal/internal_defaults_test.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package internal
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestFillMissing(t *testing.T) {
|
||||
|
||||
a := &ActionYML{}
|
||||
defs := DefaultValues{
|
||||
Name: "Default Name",
|
||||
Description: "Default Desc",
|
||||
Runs: map[string]any{"using": "node20"},
|
||||
Branding: Branding{Icon: "zap", Color: "yellow"},
|
||||
}
|
||||
FillMissing(a, defs)
|
||||
if a.Name != "Default Name" || a.Description != "Default Desc" {
|
||||
t.Error("defaults not filled correctly")
|
||||
}
|
||||
if a.Branding == nil || a.Branding.Icon != "zap" {
|
||||
t.Error("branding default not set")
|
||||
}
|
||||
if a.Runs["using"] != "node20" {
|
||||
t.Error("runs default not set")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user