@@ -29,8 +29,9 @@ var _ = Describe("ChannelController", func() {
29
29
_ = util .CreateChannel (channelName , false , "" , "" , []string {}, ns )
30
30
channel := util .GetChannel (channelName , ns )
31
31
32
- Expect (channel .Status .Conditions ).To (BeNil ())
33
32
Expect (channel .Status .ID ).To (Equal (slackMock .PublicConversationID ))
33
+ Expect (len (channel .Status .Conditions )).To (Equal (1 ))
34
+ Expect (channel .Status .Conditions [0 ].Reason ).To (Equal (status .ConditionReason ("Successful" )))
34
35
})
35
36
36
37
It ("should set error condition if channel with same name already exists" , func () {
@@ -49,8 +50,9 @@ var _ = Describe("ChannelController", func() {
49
50
_ = util .CreateChannel (channelName , true , "" , "" , []string {}, ns )
50
51
channel := util .GetChannel (channelName , ns )
51
52
52
- Expect (channel .Status .Conditions ).To (BeNil ())
53
53
Expect (channel .Status .ID ).To (Equal (slackMock .PrivateConversationID ))
54
+ Expect (len (channel .Status .Conditions )).To (Equal (1 ))
55
+ Expect (channel .Status .Conditions [0 ].Reason ).To (Equal (status .ConditionReason ("Successful" )))
54
56
})
55
57
})
56
58
@@ -61,8 +63,9 @@ var _ = Describe("ChannelController", func() {
61
63
_ = util .CreateChannel (channelName , true , "" , description , []string {}, ns )
62
64
channel := util .GetChannel (channelName , ns )
63
65
64
- Expect (channel .Status .Conditions ).To (BeNil ())
65
66
Expect (channel .Spec .Description ).To (Equal (description ))
67
+ Expect (len (channel .Status .Conditions )).To (Equal (1 ))
68
+ Expect (channel .Status .Conditions [0 ].Reason ).To (Equal (status .ConditionReason ("Successful" )))
66
69
})
67
70
})
68
71
@@ -73,18 +76,20 @@ var _ = Describe("ChannelController", func() {
73
76
_ = util .CreateChannel (channelName , true , topic , "" , []string {}, ns )
74
77
channel := util .GetChannel (channelName , ns )
75
78
76
- Expect (channel .Status .Conditions ).To (BeNil ())
77
79
Expect (channel .Spec .Topic ).To (Equal (topic ))
80
+ Expect (len (channel .Status .Conditions )).To (Equal (1 ))
81
+ Expect (channel .Status .Conditions [0 ].Reason ).To (Equal (status .ConditionReason ("Successful" )))
78
82
})
79
83
})
80
84
81
85
Context ("With user emails" , func () {
82
- It ("should not set error condition when user exists" , func () {
86
+ It ("should set success condition when user exists" , func () {
83
87
84
88
_ = util .CreateChannel (channelName , true , "" , "" , []string {mock .ExistingUserEmail }, ns )
85
89
channel := util .GetChannel (channelName , ns )
86
90
87
- Expect (channel .Status .Conditions ).To (BeNil ())
91
+ Expect (len (channel .Status .Conditions )).To (Equal (1 ))
92
+ Expect (channel .Status .Conditions [0 ].Reason ).To (Equal (status .ConditionReason ("Successful" )))
88
93
})
89
94
90
95
It ("should set error condition when user does not exists" , func () {
@@ -121,8 +126,10 @@ var _ = Describe("ChannelController", func() {
121
126
122
127
updatedChannel := util .GetChannel (channelName , ns )
123
128
124
- Expect (channel .Status .Conditions ).To (BeNil ())
125
129
Expect (updatedChannel .Spec .Name ).To (Equal (newName ))
130
+
131
+ Expect (len (channel .Status .Conditions )).To (Equal (1 ))
132
+ Expect (channel .Status .Conditions [0 ].Reason ).To (Equal (status .ConditionReason ("Successful" )))
126
133
})
127
134
})
128
135
})
@@ -133,8 +140,9 @@ var _ = Describe("ChannelController", func() {
133
140
_ = util .CreateChannel (channelName , false , "" , "" , []string {}, ns )
134
141
channel := util .GetChannel (channelName , ns )
135
142
136
- Expect (channel .Status .Conditions ).To (BeNil ())
137
143
Expect (channel .Status .ID ).ToNot (BeEmpty ())
144
+ Expect (len (channel .Status .Conditions )).To (Equal (1 ))
145
+ Expect (channel .Status .Conditions [0 ].Reason ).To (Equal (status .ConditionReason ("Successful" )))
138
146
139
147
util .DeleteChannel (channelName , ns )
140
148
0 commit comments