@@ -1887,6 +1887,52 @@ extension WireCallCenterV3Tests {
18871887 )
18881888 }
18891889
1890+ func testThatClosingAGroupCallResetsVideoState( ) {
1891+ // given
1892+ sut. handleIncomingCall (
1893+ conversationId: groupConversationID. serialized,
1894+ messageTime: Date ( ) ,
1895+ userId: otherUserID. serialized,
1896+ clientId: otherUserClientID,
1897+ isVideoCall: true ,
1898+ shouldRing: true ,
1899+ conversationType: . group
1900+ )
1901+ XCTAssert ( waitForAllGroupsToBeEmpty ( withTimeout: 0.5 ) )
1902+
1903+ sut. setVideoState ( conversationId: groupConversationID, videoState: . started)
1904+ XCTAssertEqual ( sut. videoState ( conversationId: groupConversationID) , . started)
1905+
1906+ // when
1907+ sut. closeCall ( conversationId: groupConversationID)
1908+
1909+ // then
1910+ XCTAssertEqual ( sut. videoState ( conversationId: groupConversationID) , . stopped)
1911+ }
1912+
1913+ func testThatRejoiningGroupCallAfterEnablingVideoStartsWithVideoDisabled( ) {
1914+ // given
1915+ sut. handleIncomingCall (
1916+ conversationId: groupConversationID. serialized,
1917+ messageTime: Date ( ) ,
1918+ userId: otherUserID. serialized,
1919+ clientId: otherUserClientID,
1920+ isVideoCall: true ,
1921+ shouldRing: true ,
1922+ conversationType: . group
1923+ )
1924+ XCTAssert ( waitForAllGroupsToBeEmpty ( withTimeout: 0.5 ) )
1925+ sut. setVideoState ( conversationId: groupConversationID, videoState: . started)
1926+ sut. closeCall ( conversationId: groupConversationID)
1927+
1928+ // when
1929+ sut. handleEstablishedCall ( conversationId: groupConversationID. serialized)
1930+ XCTAssert ( waitForAllGroupsToBeEmpty ( withTimeout: 0.5 ) )
1931+
1932+ // then
1933+ XCTAssertEqual ( sut. videoState ( conversationId: groupConversationID) , . stopped)
1934+ }
1935+
18901936 func testThatItWhenClosingAOneOnOneCallItDoesNotSetTheCallStateToIncomingInactive( ) {
18911937 // given
18921938 sut. handleIncomingCall (
0 commit comments