Skip to content

Commit ee1d484

Browse files
more comments
1 parent 390c68a commit ee1d484

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

util/conditions/setter_test.go

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,36 @@ func TestMarkMethods(t *testing.T) {
216216
}))
217217
}
218218

219+
func TestSetSummary(t *testing.T) {
220+
g := NewWithT(t)
221+
target := setterWithConditions(TrueCondition("foo"))
222+
223+
SetSummary(target)
224+
225+
g.Expect(Has(target, clusterv1.ReadyCondition)).To(BeTrue())
226+
}
227+
228+
func TestSetMirror(t *testing.T) {
229+
g := NewWithT(t)
230+
source := getterWithConditions(TrueCondition(clusterv1.ReadyCondition))
231+
target := setterWithConditions()
232+
233+
SetMirror(target, "foo", source)
234+
235+
g.Expect(Has(target, "foo")).To(BeTrue())
236+
}
237+
238+
func TestSetAggregate(t *testing.T) {
239+
g := NewWithT(t)
240+
source1 := getterWithConditions(TrueCondition(clusterv1.ReadyCondition))
241+
source2 := getterWithConditions(TrueCondition(clusterv1.ReadyCondition))
242+
target := setterWithConditions()
243+
244+
SetAggregate(target, "foo", []Getter{source1, source2})
245+
246+
g.Expect(Has(target, "foo")).To(BeTrue())
247+
}
248+
219249
func setterWithConditions(conditions ...*clusterv1.Condition) Setter {
220250
obj := &clusterv1.Cluster{}
221251
obj.SetConditions(conditionList(conditions...))

0 commit comments

Comments
 (0)