File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
StreamChatSwiftUITests/Tests/ChatChannel/ChannelInfo Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -222,10 +222,21 @@ class ChatChannelInfoViewModel_Tests: StreamChatTestCase {
222222 XCTAssert ( leaveButton == true )
223223 }
224224
225+ func test_chatChannelInfoVM_leaveButtonHiddenInGroup( ) {
226+ // Given
227+ let channel = mockGroup ( with: 5 , updateCapabilities: false )
228+ let viewModel = ChatChannelInfoViewModel ( channel: channel)
229+
230+ // When
231+ let leaveButton = viewModel. shouldShowLeaveConversationButton
232+
233+ // Then
234+ XCTAssert ( leaveButton == false )
235+ }
236+
225237 func test_chatChannelInfoVM_leaveButtonShownInDM( ) {
226238 // Given
227- let channel = ChatChannel . mock (
228- cid: . unique,
239+ let channel = ChatChannel . mockDMChannel (
229240 name: " Test " ,
230241 ownCapabilities: [ . deleteChannel]
231242 )
@@ -262,6 +273,7 @@ class ChatChannelInfoViewModel_Tests: StreamChatTestCase {
262273 if updateCapabilities {
263274 capabilities. insert ( . updateChannel)
264275 capabilities. insert ( . deleteChannel)
276+ capabilities. insert ( . leaveChannel)
265277 }
266278 let channel = ChatChannel . mock (
267279 cid: cid,
You can’t perform that action at this time.
0 commit comments