@@ -93,7 +93,7 @@ func TestSummaryMessages(t *testing.T) {
9393 d := & defaultMergeStrategy {
9494 getPriorityFunc : GetDefaultMergePriorityFunc (),
9595 }
96- t .Run ("Drops info messages when status is not true" , func (t * testing.T ) {
96+ t .Run ("When status is not true, drop info messages " , func (t * testing.T ) {
9797 g := NewWithT (t )
9898
9999 conditions := []ConditionWithOwnerInfo {
@@ -108,9 +108,10 @@ func TestSummaryMessages(t *testing.T) {
108108
109109 g .Expect (message ).To (Equal ("* A: Message-A\n " +
110110 "* B: Message-B\n " +
111+ // Info message of true condition C was dropped
111112 "* D: Reason-D" )) // False conditions without messages must show the reason
112113 })
113- t .Run ("When status is not true, surface only not empty messages" , func (t * testing.T ) {
114+ t .Run ("When status is true, surface only not empty messages" , func (t * testing.T ) {
114115 g := NewWithT (t )
115116
116117 conditions := []ConditionWithOwnerInfo {
@@ -129,7 +130,6 @@ func TestSummaryMessages(t *testing.T) {
129130 g := NewWithT (t )
130131
131132 conditions := []ConditionWithOwnerInfo {
132- // NOTE: objects are intentionally not in order so we can validate they are sorted by name
133133 {OwnerResource : ConditionOwnerInfo {Kind : "MachineDeployment" , Name : "obj01" }, Condition : metav1.Condition {Type : "A" , Reason : "Reason-A" , Message : "Message-A" , Status : metav1 .ConditionTrue }},
134134 {OwnerResource : ConditionOwnerInfo {Kind : "MachineDeployment" , Name : "obj01" }, Condition : metav1.Condition {Type : "B" , Reason : "Reason-B" , Message : "* Message-B" , Status : metav1 .ConditionTrue }},
135135 {OwnerResource : ConditionOwnerInfo {Kind : "MachineDeployment" , Name : "obj01" }, Condition : metav1.Condition {Type : "C" , Reason : "Reason-C" , Message : "* Message-C1\n * Message-C2" , Status : metav1 .ConditionTrue }},
0 commit comments