Skip to content

Commit

Permalink
Fixing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
robscott committed Apr 26, 2021
1 parent 706067b commit 1305e3d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/capacity/table_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down Expand Up @@ -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)
})
}
}

0 comments on commit 1305e3d

Please sign in to comment.