Skip to content

Commit

Permalink
fix: fix tests without introducing a regression bug
Browse files Browse the repository at this point in the history
Signed-off-by: aaronschweig <aaron.schweig@gmail.com>
  • Loading branch information
aaronschweig committed Feb 18, 2025
1 parent aacbb7c commit f811f44
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion internal/model1/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func IsValid(ns string, h Header, r Row) bool {
return true
}

return strings.ToLower(strings.TrimSpace(r.Fields[idx])) == "true"
return strings.TrimSpace(r.Fields[idx]) == "" || strings.ToLower(strings.TrimSpace(r.Fields[idx])) == "true"
}

func sortLabels(m map[string]string) (keys, vals []string) {
Expand Down
4 changes: 2 additions & 2 deletions internal/render/pod_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func TestPodColorer(t *testing.T) {
re: model1.RowEvent{
Kind: model1.EventAdd,
Row: model1.Row{
Fields: model1.Fields{"blee", "fred", "1/1", "0", render.Running, "true"},
Fields: model1.Fields{"blee", "fred", "1/1", "0", render.Running, ""},
},
},
e: model1.StdColor,
Expand Down Expand Up @@ -115,7 +115,7 @@ func TestPodColorer(t *testing.T) {
re: model1.RowEvent{
Kind: model1.EventAdd,
Row: model1.Row{
Fields: model1.Fields{"blee", "fred", "1/1", "0", "blee", "true"},
Fields: model1.Fields{"blee", "fred", "1/1", "0", "blee", ""},
},
},
e: model1.AddColor,
Expand Down

0 comments on commit f811f44

Please sign in to comment.