From 1305e3da71451dceef2d18016c07e6e726dd86dc Mon Sep 17 00:00:00 2001 From: Rob Scott Date: Sun, 25 Apr 2021 22:10:10 -0700 Subject: [PATCH] Fixing tests --- pkg/capacity/table_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/capacity/table_test.go b/pkg/capacity/table_test.go index 2e6760c2..171c44e7 100644 --- a/pkg/capacity/table_test.go +++ b/pkg/capacity/table_test.go @@ -25,18 +25,21 @@ func TestGetLineItems(t *testing.T) { showPods: false, showUtil: false, showContainers: false, + showNamespace: false, } tpSome := &tablePrinter{ showPods: false, showUtil: false, showContainers: true, + showNamespace: true, } tpAll := &tablePrinter{ showPods: true, showUtil: true, showContainers: true, + showNamespace: true, } tl := &tableLine{ @@ -105,8 +108,7 @@ func TestGetLineItems(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { lineItems := tc.tp.getLineItems(tl) - assert.Len(t, lineItems, len(tc.expected)) - assert.ElementsMatch(t, lineItems, tc.expected) + assert.ElementsMatchf(t, lineItems, tc.expected, "Expected: %+v\nGot: %+v", tc.expected, lineItems) }) } }