Fix unit tests following botched SDK bump

This commit is contained in:
Stefan Ceriu
2023-10-12 11:46:32 +03:00
parent 518ce3a923
commit 801799ad5e
5 changed files with 10 additions and 10 deletions

View File

@@ -21,7 +21,7 @@ import XCTest
final class MediaLoaderTests: XCTestCase {
func testMediaRequestCoalescing() async {
let mediaLoadingClient = SDKClientMock()
mediaLoadingClient.getMediaContentMediaSourceReturnValue = []
mediaLoadingClient.getMediaContentMediaSourceReturnValue = Data()
let mediaLoader = MediaLoader(client: mediaLoadingClient)
let mediaSource = MediaSourceProxy(url: URL.documentsDirectory, mimeType: nil)
@@ -39,7 +39,7 @@ final class MediaLoaderTests: XCTestCase {
func testMediaThumbnailRequestCoalescing() async {
let mediaLoadingClient = SDKClientMock()
mediaLoadingClient.getMediaThumbnailMediaSourceWidthHeightReturnValue = []
mediaLoadingClient.getMediaThumbnailMediaSourceWidthHeightReturnValue = Data()
let mediaLoader = MediaLoader(client: mediaLoadingClient)
let mediaSource = MediaSourceProxy(url: URL.documentsDirectory, mimeType: nil)

View File

@@ -194,7 +194,7 @@ class NotificationSettingsEditScreenViewModelTests: XCTestCase {
func testSetModeFailure() async throws {
notificationSettingsProxy.getDefaultRoomNotificationModeIsEncryptedIsOneToOneReturnValue = .mentionsAndKeywordsOnly
notificationSettingsProxy.setDefaultRoomNotificationModeIsEncryptedIsOneToOneModeThrowableError = NotificationSettingsError.Generic(message: "error")
notificationSettingsProxy.setDefaultRoomNotificationModeIsEncryptedIsOneToOneModeThrowableError = NotificationSettingsError.Generic(msg: "error")
viewModel = NotificationSettingsEditScreenViewModel(chatType: .oneToOneChat,
userSession: userSession,
notificationSettingsProxy: notificationSettingsProxy)

View File

@@ -277,7 +277,7 @@ class NotificationSettingsScreenViewModelTests: XCTestCase {
}
func testToggleRoomMentionFailure() async throws {
notificationSettingsProxy.setRoomMentionEnabledEnabledThrowableError = NotificationSettingsError.Generic(message: "error")
notificationSettingsProxy.setRoomMentionEnabledEnabledThrowableError = NotificationSettingsError.Generic(msg: "error")
notificationSettingsProxy.isRoomMentionEnabledReturnValue = false
let deferredInitialFetch = deferFulfillment(viewModel.context.$viewState) { state in
@@ -357,7 +357,7 @@ class NotificationSettingsScreenViewModelTests: XCTestCase {
}
func testToggleCallsFailure() async throws {
notificationSettingsProxy.setCallEnabledEnabledThrowableError = NotificationSettingsError.Generic(message: "error")
notificationSettingsProxy.setCallEnabledEnabledThrowableError = NotificationSettingsError.Generic(msg: "error")
notificationSettingsProxy.isCallEnabledReturnValue = false
let deferredInitialFetch = deferFulfillment(viewModel.context.$viewState) { state in

View File

@@ -413,7 +413,7 @@ class RoomDetailsScreenViewModelTests: XCTestCase {
// MARK: - Notifications
func testNotificationLoadingSettingsFailure() async throws {
notificationSettingsProxyMock.getNotificationSettingsRoomIdIsEncryptedIsOneToOneThrowableError = NotificationSettingsError.Generic(message: "error")
notificationSettingsProxyMock.getNotificationSettingsRoomIdIsEncryptedIsOneToOneThrowableError = NotificationSettingsError.Generic(msg: "error")
viewModel = RoomDetailsScreenViewModel(accountUserID: "@owner:somewhere.com",
roomProxy: roomProxyMock,
mediaProvider: MockMediaProvider(),
@@ -506,7 +506,7 @@ class RoomDetailsScreenViewModelTests: XCTestCase {
defer {
expectation.fulfill()
}
throw NotificationSettingsError.Generic(message: "unmute error")
throw NotificationSettingsError.Generic(msg: "unmute error")
}
context.send(viewAction: .processToogleMuteNotifications)
await fulfillment(of: [expectation])
@@ -531,7 +531,7 @@ class RoomDetailsScreenViewModelTests: XCTestCase {
defer {
expectation.fulfill()
}
throw NotificationSettingsError.Generic(message: "mute error")
throw NotificationSettingsError.Generic(msg: "mute error")
}
context.send(viewAction: .processToogleMuteNotifications)
await fulfillment(of: [expectation])

View File

@@ -68,7 +68,7 @@ class RoomNotificationSettingsScreenViewModelTests: XCTestCase {
}
func testInitialStateFailure() async throws {
notificationSettingsProxyMock.getNotificationSettingsRoomIdIsEncryptedIsOneToOneThrowableError = NotificationSettingsError.Generic(message: "error")
notificationSettingsProxyMock.getNotificationSettingsRoomIdIsEncryptedIsOneToOneThrowableError = NotificationSettingsError.Generic(msg: "error")
let viewModel = RoomNotificationSettingsScreenViewModel(notificationSettingsProxy: notificationSettingsProxyMock,
roomProxy: roomProxyMock,
displayAsUserDefinedRoomSettings: false)
@@ -235,7 +235,7 @@ class RoomNotificationSettingsScreenViewModelTests: XCTestCase {
func testDeleteCustomSettingTappedFailure() async throws {
notificationSettingsProxyMock.getNotificationSettingsRoomIdIsEncryptedIsOneToOneReturnValue = RoomNotificationSettingsProxyMock(with: .init(mode: .mentionsAndKeywordsOnly, isDefault: false))
notificationSettingsProxyMock.restoreDefaultNotificationModeRoomIdThrowableError = NotificationSettingsError.Generic(message: "error")
notificationSettingsProxyMock.restoreDefaultNotificationModeRoomIdThrowableError = NotificationSettingsError.Generic(msg: "error")
let viewModel = RoomNotificationSettingsScreenViewModel(notificationSettingsProxy: notificationSettingsProxyMock,
roomProxy: roomProxyMock,
displayAsUserDefinedRoomSettings: true)