Add test case for removing an entire object

Signed-off-by: Ryan Hockstad <ryanhockstad@gmail.com>
pull/12879/head
Ryan Hockstad 9 months ago
parent 60fcce18d1
commit ef2eb55283

@ -57,6 +57,7 @@ pequod:
nested: nested:
foo: true foo: true
boat: null boat: null
object: null
`) `)
func withDeps(c *chart.Chart, deps ...*chart.Chart) *chart.Chart { func withDeps(c *chart.Chart, deps ...*chart.Chart) *chart.Chart {
@ -118,6 +119,7 @@ func TestCoalesceValues(t *testing.T) {
"name": "ahab", "name": "ahab",
"boat": true, "boat": true,
"nested": map[string]interface{}{"foo": false, "boat": true}, "nested": map[string]interface{}{"foo": false, "boat": true},
"object": map[string]interface{}{"foo": "bar"},
}, },
}, },
), ),
@ -227,6 +229,10 @@ func TestCoalesceValues(t *testing.T) {
t.Error("Expected sub-subchart nested boat key to be removed, still present") t.Error("Expected sub-subchart nested boat key to be removed, still present")
} }
if _, ok := subsubchart["object"]; ok {
t.Error("Expected sub-subchart object map to be removed, still present")
}
// CoalesceValues should not mutate the passed arguments // CoalesceValues should not mutate the passed arguments
is.Equal(valsCopy, vals) is.Equal(valsCopy, vals)
} }

Loading…
Cancel
Save