From afbb062e7cfebc4a045ad304f66134c7d2ca0e57 Mon Sep 17 00:00:00 2001 From: Charlie Chiang Date: Mon, 9 May 2022 14:11:48 +0000 Subject: [PATCH] Refactor: use more concise method to check length Signed-off-by: Charlie Chiang --- references/cli/addon_suite_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/references/cli/addon_suite_test.go b/references/cli/addon_suite_test.go index ade09c2bc..6a2d4395c 100644 --- a/references/cli/addon_suite_test.go +++ b/references/cli/addon_suite_test.go @@ -57,7 +57,7 @@ var _ = Describe("Output of listing addons tests", func() { When("there is no addons installed", func() { It("should not have any enabled addon", func() { - Expect(len(actualTable.Rows) > 1).To(BeTrue()) + Expect(actualTable.Rows).ToNot(HaveLen(0)) for idx, row := range actualTable.Rows { // Skip header if idx == 0 { @@ -80,7 +80,7 @@ var _ = Describe("Output of listing addons tests", func() { It("should print fluxcd addon as local", func() { matchedRows := getRowsByName("fluxcd") - Expect(len(matchedRows) > 0).To(BeTrue()) + Expect(matchedRows).ToNot(HaveLen(0)) // Only use first row (local first), check column REGISTRY(1) = local Expect(matchedRows[0].Cells[1].Data).To(Equal("local")) Eventually(func() error {