Skip to content

Commit

Permalink
Fixed the tests
Browse files Browse the repository at this point in the history
  • Loading branch information
martinmitrevski committed Dec 23, 2024
1 parent d84e738 commit 076c74a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
4 changes: 4 additions & 0 deletions StreamVideoTests/Mock/MockLocalMediaAdapter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ final class MockLocalMediaAdapter: LocalMediaAdapting, Mockable {
stubbedFunctionInput[.trackInfo]?.append(.trackInfo)
return stubbedFunction[.trackInfo] as? [Stream_Video_Sfu_Models_TrackInfo] ?? []
}

func trackInfo(for collectionType: RTCPeerConnectionTrackInfoCollectionType) -> [Stream_Video_Sfu_Models_TrackInfo] {
trackInfo()
}

func didUpdatePublishOptions(_ publishOptions: PublishOptions) async throws {
stubbedFunctionInput[.didUpdatePublishOptions]?
Expand Down
3 changes: 2 additions & 1 deletion StreamVideoTests/Mock/MockRTCPeerConnectionCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,8 @@ final class MockRTCPeerConnectionCoordinator:
}

override func trackInfo(
for type: TrackType
for type: TrackType,
collectionType: RTCPeerConnectionTrackInfoCollectionType
) -> [Stream_Video_Sfu_Models_TrackInfo] {
stubbedFunctionInput[.trackInfo]?.append(
.trackInfo(trackType: type)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ final class LocalAudioMediaAdapter_Tests: XCTestCase, @unchecked Sendable {
// MARK: - trackInfo

func test_trackInfo_noPublishedTransceivers_returnsEmptyArray() {
XCTAssertTrue(subject.trackInfo().isEmpty)
XCTAssertTrue(subject.trackInfo(for: .allAvailable).isEmpty)
}

// func test_trackInfo_twoPublishedTransceivers_returnsCorrectArray() async throws {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ final class WebRTCJoinRequestFactory_Tests: XCTestCase, @unchecked Sendable {
)
mockPublisher?.stubbedTrackInfo = expected

let result = subject.buildAnnouncedTracks(mockPublisher)
let result = subject.buildAnnouncedTracks(mockPublisher, collectionType: .allAvailable)
let expected: [Stream_Video_Sfu_Models_TrackInfo] = (expected[.audio] ?? [])
+ (expected[.video] ?? [])
+ (expected[.screenshare] ?? [])
Expand Down

0 comments on commit 076c74a

Please sign in to comment.