Skip to content

Commit

Permalink
add tests for parsepredicateSelector
Browse files Browse the repository at this point in the history
  • Loading branch information
varshaprasad96 committed Dec 6, 2021
1 parent 8b07406 commit 3648442
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions pkg/reconciler/reconciler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1171,6 +1171,27 @@ var _ = Describe("Reconciler", func() {
})
})
})

var _ = Describe("Test predicate selector", func() {
It("verifying when a valid selector is passed", func() {
selectorPass := metav1.LabelSelector{
MatchLabels: map[string]string{
"testKey": "testValue",
},
}

passPredicate, err := parsePredicateSelector(selectorPass)
Expect(err).NotTo(HaveOccurred())
Expect(passPredicate).NotTo(BeNil())
})

It("verifying there is no error when no predicate is passed", func() {
noSelector := metav1.LabelSelector{}
nilPredicate, err := parsePredicateSelector(noSelector)
Expect(err).NotTo(HaveOccurred())
Expect(nilPredicate).To(BeNil())
})
})
})

func getManagerOrFail() manager.Manager {
Expand Down

0 comments on commit 3648442

Please sign in to comment.