@@ -93,7 +93,7 @@ func TestSummaryMessages(t *testing.T) {
93
93
d := & defaultMergeStrategy {
94
94
getPriorityFunc : GetDefaultMergePriorityFunc (),
95
95
}
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 ) {
97
97
g := NewWithT (t )
98
98
99
99
conditions := []ConditionWithOwnerInfo {
@@ -108,9 +108,10 @@ func TestSummaryMessages(t *testing.T) {
108
108
109
109
g .Expect (message ).To (Equal ("* A: Message-A\n " +
110
110
"* B: Message-B\n " +
111
+ // Info message of true condition C was dropped
111
112
"* D: Reason-D" )) // False conditions without messages must show the reason
112
113
})
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 ) {
114
115
g := NewWithT (t )
115
116
116
117
conditions := []ConditionWithOwnerInfo {
@@ -129,7 +130,6 @@ func TestSummaryMessages(t *testing.T) {
129
130
g := NewWithT (t )
130
131
131
132
conditions := []ConditionWithOwnerInfo {
132
- // NOTE: objects are intentionally not in order so we can validate they are sorted by name
133
133
{OwnerResource : ConditionOwnerInfo {Kind : "MachineDeployment" , Name : "obj01" }, Condition : metav1.Condition {Type : "A" , Reason : "Reason-A" , Message : "Message-A" , Status : metav1 .ConditionTrue }},
134
134
{OwnerResource : ConditionOwnerInfo {Kind : "MachineDeployment" , Name : "obj01" }, Condition : metav1.Condition {Type : "B" , Reason : "Reason-B" , Message : "* Message-B" , Status : metav1 .ConditionTrue }},
135
135
{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