Skip to content

Commit

Permalink
Tests Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ipavlidakis committed Dec 17, 2024
1 parent 218af30 commit 1b6bfab
Show file tree
Hide file tree
Showing 26 changed files with 3,493 additions and 3,604 deletions.
20 changes: 4 additions & 16 deletions StreamVideo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,6 @@
406B3C162C90343300FC93A1 /* LocalVideoMediaAdapter_Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 406B3C152C90342E00FC93A1 /* LocalVideoMediaAdapter_Tests.swift */; };
406B3C192C90385100FC93A1 /* VideoCapturerProviding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 406B3C182C90384800FC93A1 /* VideoCapturerProviding.swift */; };
406B3C1C2C903A2B00FC93A1 /* MockVideoCapturerFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 406B3C1A2C903A2500FC93A1 /* MockVideoCapturerFactory.swift */; };
406B3C202C903B0700FC93A1 /* MockCameraVideoCapturer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 406B3C1E2C903B0000FC93A1 /* MockCameraVideoCapturer.swift */; };
406B3C252C903BDE00FC93A1 /* MockVideoCapturer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 406B3C222C903BD700FC93A1 /* MockVideoCapturer.swift */; };
406B3C272C904F7100FC93A1 /* LocalScreenShareMediaAdapter_Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 406B3C262C904F6900FC93A1 /* LocalScreenShareMediaAdapter_Tests.swift */; };
406B3C292C905E9D00FC93A1 /* AudioMediaAdapter_Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 406B3C282C905E9D00FC93A1 /* AudioMediaAdapter_Tests.swift */; };
406B3C2B2C90601600FC93A1 /* MockLocalMediaAdapter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 406B3C2A2C90601600FC93A1 /* MockLocalMediaAdapter.swift */; };
Expand Down Expand Up @@ -427,6 +425,7 @@
40AF6A4B2C9369A900BA2935 /* WebRTCCoordinatorStateMachine_DisconnectedStageTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 40AF6A4A2C9369A900BA2935 /* WebRTCCoordinatorStateMachine_DisconnectedStageTests.swift */; };
40B31AA82D10594F005FB448 /* PublishOptions+Dummy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 40B31AA72D10594F005FB448 /* PublishOptions+Dummy.swift */; };
40B31AA92D10594F005FB448 /* PublishOptions+Dummy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 40B31AA72D10594F005FB448 /* PublishOptions+Dummy.swift */; };
40B31AAB2D107948005FB448 /* MockStreamVideoCapturer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 40B31AAA2D107943005FB448 /* MockStreamVideoCapturer.swift */; };
40B499CA2AC1A5E100A53B60 /* OSLogDestination.swift in Sources */ = {isa = PBXBuildFile; fileRef = 40B499C92AC1A5E100A53B60 /* OSLogDestination.swift */; };
40B499CC2AC1A90F00A53B60 /* DeeplinkTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 40B499CB2AC1A90F00A53B60 /* DeeplinkTests.swift */; };
40B499CE2AC1AA0900A53B60 /* AppEnvironment.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4030E59F2A9DF5BD003E8CBA /* AppEnvironment.swift */; };
Expand Down Expand Up @@ -843,7 +842,6 @@
841BAA492BD15CDE000C73E4 /* CollectUserFeedbackRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 841BAA302BD15CDE000C73E4 /* CollectUserFeedbackRequest.swift */; };
841F2C8029429DEC00D8D655 /* StreamVideoSwiftUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 84F73807287C141000A363F4 /* StreamVideoSwiftUI.framework */; };
841FF5032A5D6FEC00809BBB /* CallsController_Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 841FF5022A5D6FEC00809BBB /* CallsController_Tests.swift */; };
841FF5052A5D815700809BBB /* VideoCapturerUtils_Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 841FF5042A5D815700809BBB /* VideoCapturerUtils_Tests.swift */; };
841FF5152A5E99B400809BBB /* CallEventsHandler_Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 841FF5142A5E99B400809BBB /* CallEventsHandler_Tests.swift */; };
841FF5172A5EA7F600809BBB /* CallParticipants_Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 841FF5162A5EA7F600809BBB /* CallParticipants_Tests.swift */; };
841FF51B2A5FED4800809BBB /* SystemEnvironment+XStreamClient.swift in Sources */ = {isa = PBXBuildFile; fileRef = 841FF51A2A5FED4800809BBB /* SystemEnvironment+XStreamClient.swift */; };
Expand Down Expand Up @@ -985,7 +983,6 @@
845C09952C10A7D700F725B3 /* SessionTimer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 845C09902C0E0B7600F725B3 /* SessionTimer.swift */; };
845C09972C11AAA200F725B3 /* RejectCallRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 845C09962C11AAA100F725B3 /* RejectCallRequest.swift */; };
845E31062A7121D6004DC470 /* BroadcastObserver_Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 845E31052A7121D6004DC470 /* BroadcastObserver_Tests.swift */; };
845E31082A712389004DC470 /* BroadcastUtils_Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 845E31072A712389004DC470 /* BroadcastUtils_Tests.swift */; };
8468821328DFA448003BA9EE /* UnsecureRepository.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8468821228DFA448003BA9EE /* UnsecureRepository.swift */; };
8469593229BB3D7500134EA0 /* SignalServer_Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8469593129BB3D7500134EA0 /* SignalServer_Tests.swift */; };
8469593429BB5CE200134EA0 /* HTTPConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8469593329BB5CE200134EA0 /* HTTPConfig.swift */; };
Expand Down Expand Up @@ -1646,8 +1643,6 @@
406B3C152C90342E00FC93A1 /* LocalVideoMediaAdapter_Tests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocalVideoMediaAdapter_Tests.swift; sourceTree = "<group>"; };
406B3C182C90384800FC93A1 /* VideoCapturerProviding.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VideoCapturerProviding.swift; sourceTree = "<group>"; };
406B3C1A2C903A2500FC93A1 /* MockVideoCapturerFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MockVideoCapturerFactory.swift; sourceTree = "<group>"; };
406B3C1E2C903B0000FC93A1 /* MockCameraVideoCapturer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MockCameraVideoCapturer.swift; sourceTree = "<group>"; };
406B3C222C903BD700FC93A1 /* MockVideoCapturer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MockVideoCapturer.swift; sourceTree = "<group>"; };
406B3C262C904F6900FC93A1 /* LocalScreenShareMediaAdapter_Tests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocalScreenShareMediaAdapter_Tests.swift; sourceTree = "<group>"; };
406B3C282C905E9D00FC93A1 /* AudioMediaAdapter_Tests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AudioMediaAdapter_Tests.swift; sourceTree = "<group>"; };
406B3C2A2C90601600FC93A1 /* MockLocalMediaAdapter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MockLocalMediaAdapter.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1761,6 +1756,7 @@
40AF6A482C935EB600BA2935 /* WebRTCCoordinatorStateMachine_CleanUpStageTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WebRTCCoordinatorStateMachine_CleanUpStageTests.swift; sourceTree = "<group>"; };
40AF6A4A2C9369A900BA2935 /* WebRTCCoordinatorStateMachine_DisconnectedStageTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WebRTCCoordinatorStateMachine_DisconnectedStageTests.swift; sourceTree = "<group>"; };
40B31AA72D10594F005FB448 /* PublishOptions+Dummy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "PublishOptions+Dummy.swift"; sourceTree = "<group>"; };
40B31AAA2D107943005FB448 /* MockStreamVideoCapturer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MockStreamVideoCapturer.swift; sourceTree = "<group>"; };
40B499C92AC1A5E100A53B60 /* OSLogDestination.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OSLogDestination.swift; sourceTree = "<group>"; };
40B499CB2AC1A90F00A53B60 /* DeeplinkTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeeplinkTests.swift; sourceTree = "<group>"; };
40BBC4762C6227D5002AEF92 /* DemoTranscriptionButtonView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DemoTranscriptionButtonView.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -2111,7 +2107,6 @@
841BAA2E2BD15CDE000C73E4 /* CallTranscriptionReadyEvent.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CallTranscriptionReadyEvent.swift; sourceTree = "<group>"; };
841BAA302BD15CDE000C73E4 /* CollectUserFeedbackRequest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CollectUserFeedbackRequest.swift; sourceTree = "<group>"; };
841FF5022A5D6FEC00809BBB /* CallsController_Tests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CallsController_Tests.swift; sourceTree = "<group>"; };
841FF5042A5D815700809BBB /* VideoCapturerUtils_Tests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VideoCapturerUtils_Tests.swift; sourceTree = "<group>"; };
841FF5142A5E99B400809BBB /* CallEventsHandler_Tests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CallEventsHandler_Tests.swift; sourceTree = "<group>"; };
841FF5162A5EA7F600809BBB /* CallParticipants_Tests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CallParticipants_Tests.swift; sourceTree = "<group>"; };
841FF51A2A5FED4800809BBB /* SystemEnvironment+XStreamClient.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "SystemEnvironment+XStreamClient.swift"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -2249,7 +2244,6 @@
845C09922C0E1BF900F725B3 /* DemoSessionTimerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DemoSessionTimerView.swift; sourceTree = "<group>"; };
845C09962C11AAA100F725B3 /* RejectCallRequest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RejectCallRequest.swift; sourceTree = "<group>"; };
845E31052A7121D6004DC470 /* BroadcastObserver_Tests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BroadcastObserver_Tests.swift; sourceTree = "<group>"; };
845E31072A712389004DC470 /* BroadcastUtils_Tests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BroadcastUtils_Tests.swift; sourceTree = "<group>"; };
8468821228DFA448003BA9EE /* UnsecureRepository.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UnsecureRepository.swift; sourceTree = "<group>"; };
8469593129BB3D7500134EA0 /* SignalServer_Tests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SignalServer_Tests.swift; sourceTree = "<group>"; };
8469593329BB5CE200134EA0 /* HTTPConfig.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HTTPConfig.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -4698,7 +4692,6 @@
8414080E29F2838F00FF2D7C /* RawJSON_Tests.swift */,
84BB570D2A20D7BB0002C123 /* Mapping_Tests.swift */,
84A4DCBA2A41DC6E00B1D1BF /* AsyncAssert.swift */,
845E31072A712389004DC470 /* BroadcastUtils_Tests.swift */,
400D63F62AC3273F0000BB30 /* ThermalStateObserverTests.swift */,
84D6E5392B3AD10000D0056C /* RepeatingTimer_Tests.swift */,
4031D7F72B83C087002EC6E4 /* StreamCallAudioRecorderTests.swift */,
Expand Down Expand Up @@ -5031,6 +5024,7 @@
8492B87629081CE700006649 /* Mock */ = {
isa = PBXGroup;
children = (
40B31AAA2D107943005FB448 /* MockStreamVideoCapturer.swift */,
4067F3182CDA469C002E28BD /* MockAudioSession.swift */,
409774AD2CC1979F00E0D3EE /* MockCallController.swift */,
40C75BB62CB4044600C167C3 /* MockThermalStateObserver.swift */,
Expand All @@ -5044,9 +5038,7 @@
406B3C402C919F5100FC93A1 /* MockRTCPeerConnectionCoordinatorStack.swift */,
406B3C3E2C919BAE00FC93A1 /* MockSFUStack.swift */,
406B3C1A2C903A2500FC93A1 /* MockVideoCapturerFactory.swift */,
406B3C1E2C903B0000FC93A1 /* MockCameraVideoCapturer.swift */,
406B3C2A2C90601600FC93A1 /* MockLocalMediaAdapter.swift */,
406B3C222C903BD700FC93A1 /* MockVideoCapturer.swift */,
406B3C0D2C8F865F00FC93A1 /* MockStreamCallAudioRecorder.swift */,
406B3C112C8F86FF00FC93A1 /* MockActiveCallProvider.swift */,
406B3C092C8F604A00FC93A1 /* PeerConnectionFactory+Mock.swift */,
Expand Down Expand Up @@ -5281,7 +5273,6 @@
845E31042A7121BE004DC470 /* Screensharing */,
8414081229F28B5600FF2D7C /* RTCConfiguration_Tests.swift */,
8446AF902A4D84F4002AB07B /* Retries_Tests.swift */,
841FF5042A5D815700809BBB /* VideoCapturerUtils_Tests.swift */,
40986C3D2CD1148F00510F88 /* AudioSession_Tests.swift */,
);
path = WebRTC;
Expand Down Expand Up @@ -7052,11 +7043,11 @@
8414080F29F2838F00FF2D7C /* RawJSON_Tests.swift in Sources */,
40E9B3B72BCD941600ACF18F /* SFUResponse+Dummy.swift in Sources */,
40382F432C89CF9700C2D00F /* Stream_Video_Sfu_Models_ConnectionQuality+Convenience.swift in Sources */,
406B3C252C903BDE00FC93A1 /* MockVideoCapturer.swift in Sources */,
40F017672BBEF1B700E89FD1 /* CallIngressResponse+Dummy.swift in Sources */,
406B3C4F2C91F0CA00FC93A1 /* WebRTCCoordinatorStateMachine_ConnectingStageTests.swift in Sources */,
40C9E44C2C948A1F00802B28 /* WebRTCAuthenticator_Tests.swift in Sources */,
406B3C292C905E9D00FC93A1 /* AudioMediaAdapter_Tests.swift in Sources */,
40B31AAB2D107948005FB448 /* MockStreamVideoCapturer.swift in Sources */,
406303422AD848000091AE77 /* CallParticipant_Mock.swift in Sources */,
845C09872C0DF3D100F725B3 /* LimitsSettingsResponse+Dummy.swift in Sources */,
841FF5032A5D6FEC00809BBB /* CallsController_Tests.swift in Sources */,
Expand All @@ -7066,7 +7057,6 @@
403FB1542BFE1E360047A696 /* StreamCallStateMachineStageIdleStage_Tests.swift in Sources */,
406B3C342C908B0A00FC93A1 /* ICEAdapter_Tests.swift in Sources */,
40AB34CC2C5D440E00B5B6B3 /* MockSignalServer.swift in Sources */,
845E31082A712389004DC470 /* BroadcastUtils_Tests.swift in Sources */,
4029E9572CB943E800E1D571 /* CollectionDelayedUpdateObserver_Tests.swift in Sources */,
406B3C5B2C92CFFD00FC93A1 /* WebRTCCoordinatorStateMachine_JoinedStageTests.swift in Sources */,
84F58B8729EEABF700010C4C /* EventBatcher_Mock.swift in Sources */,
Expand Down Expand Up @@ -7102,7 +7092,6 @@
40C75BB72CB4044600C167C3 /* MockThermalStateObserver.swift in Sources */,
842747EC29EED59000E063AD /* JSONDecoder_Tests.swift in Sources */,
406B3C142C8F870400FC93A1 /* MockActiveCallProvider.swift in Sources */,
841FF5052A5D815700809BBB /* VideoCapturerUtils_Tests.swift in Sources */,
40C2B5C62C2D7AED00EC2C2D /* RejectionReasonProvider_Tests.swift in Sources */,
403FB15C2BFE22170047A696 /* StreamCallStateMachineStageAcceptingStage_Tests.swift in Sources */,
841FF5172A5EA7F600809BBB /* CallParticipants_Tests.swift in Sources */,
Expand Down Expand Up @@ -7163,7 +7152,6 @@
4351AEAF2A40591800D32D0D /* CallCRUDTests.swift in Sources */,
84F58B8529EEABC100010C4C /* EventDecoder_Mock.swift in Sources */,
8414081129F284A800FF2D7C /* AssertJSONEqual.swift in Sources */,
406B3C202C903B0700FC93A1 /* MockCameraVideoCapturer.swift in Sources */,
40382F382C89C0F500C2D00F /* MockRTCPeerConnectionCoordinator.swift in Sources */,
4097B37E2BF4B06A0057992D /* GetCallResponse+Dummy.swift in Sources */,
846D16292A52F3A10036CE4C /* MicrophoneManager_Tests.swift in Sources */,
Expand Down
15 changes: 8 additions & 7 deletions StreamVideoTests/Controllers/CallController_Tests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import AVFoundation
@testable import StreamVideo
@preconcurrency import XCTest

final class CallController_Tests: StreamVideoTestCase, @unchecked Sendable {
final class CallController_Tests: StreamVideoTestCase, @unchecked Sendable {

private static var videoConfig: VideoConfig! = .dummy()

Expand Down Expand Up @@ -97,7 +97,7 @@ final class CallController_Tests: StreamVideoTestCase, @unchecked Sendable {

func test_cleanUp_callIsNil() async throws {
subject.call = .dummy()

subject.cleanUp()

XCTAssertNil(subject.call)
Expand Down Expand Up @@ -503,13 +503,14 @@ final class CallController_Tests: StreamVideoTestCase, @unchecked Sendable {
maxBitrate: 1000
)

let videoOptions = await mockWebRTCCoordinatorFactory
let publishOptions = await mockWebRTCCoordinatorFactory
.mockCoordinatorStack
.coordinator
.stateAdapter
.videoOptions
XCTAssertEqual(videoOptions.preferredVideoCodec, .vp9)
XCTAssertEqual(videoOptions.preferredBitrate, 1000)
.publishOptions
XCTAssertEqual(publishOptions.video.count, 1)
XCTAssertEqual(publishOptions.video.first?.codec, .vp9)
XCTAssertEqual(publishOptions.video.first?.bitrate, 1000)
}

// MARK: - Private helpers
Expand Down Expand Up @@ -639,4 +640,4 @@ final class CallController_Tests: StreamVideoTestCase, @unchecked Sendable {
.participants.count == 1
}
}
}
}
Loading

0 comments on commit 1b6bfab

Please sign in to comment.