mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 12:07:55 +00:00
Tidy up mock creation. (#5627)
* Use our standard XYZMock(.init()) pattern everywhere instead of XYZMock.default. * Remove the configuration parameter label on mock convenience inits. * Update the enterprise submodule.
This commit is contained in:
@@ -45,8 +45,8 @@ final class RoomScreenViewModelTests {
|
||||
ongoingCallRoomIDPublisher: .init(.init(nil)),
|
||||
appSettings: appSettings,
|
||||
appHooks: AppHooks(),
|
||||
analyticsService: AnalyticsServiceMock.default,
|
||||
userIndicatorController: UserIndicatorControllerMock.default)
|
||||
analyticsService: AnalyticsServiceMock(.init()),
|
||||
userIndicatorController: UserIndicatorControllerMock())
|
||||
self.viewModel = viewModel
|
||||
|
||||
// check if in the default state is not showing but is indeed loading
|
||||
@@ -126,8 +126,8 @@ final class RoomScreenViewModelTests {
|
||||
ongoingCallRoomIDPublisher: .init(.init(nil)),
|
||||
appSettings: appSettings,
|
||||
appHooks: AppHooks(),
|
||||
analyticsService: AnalyticsServiceMock.default,
|
||||
userIndicatorController: UserIndicatorControllerMock.default)
|
||||
analyticsService: AnalyticsServiceMock(.init()),
|
||||
userIndicatorController: UserIndicatorControllerMock())
|
||||
self.viewModel = viewModel
|
||||
|
||||
// check if the banner is now in a loaded state and is showing the counter
|
||||
@@ -187,8 +187,8 @@ final class RoomScreenViewModelTests {
|
||||
ongoingCallRoomIDPublisher: .init(.init(nil)),
|
||||
appSettings: appSettings,
|
||||
appHooks: AppHooks(),
|
||||
analyticsService: AnalyticsServiceMock.default,
|
||||
userIndicatorController: UserIndicatorControllerMock.default)
|
||||
analyticsService: AnalyticsServiceMock(.init()),
|
||||
userIndicatorController: UserIndicatorControllerMock())
|
||||
self.viewModel = viewModel
|
||||
|
||||
// check if the banner is now in a loaded state and is showing the counter
|
||||
@@ -229,7 +229,7 @@ final class RoomScreenViewModelTests {
|
||||
var configuration = JoinedRoomProxyMockConfiguration(id: "TestID", name: "StartingName", avatarURL: nil, hasOngoingCall: false)
|
||||
let roomProxyMock = JoinedRoomProxyMock(configuration)
|
||||
|
||||
let powerLevelsMock = RoomPowerLevelsProxyMock(configuration: .init())
|
||||
let powerLevelsMock = RoomPowerLevelsProxyMock(.init())
|
||||
powerLevelsMock.canUserJoinCallUserIDReturnValue = .success(false)
|
||||
powerLevelsMock.canOwnUserJoinCallReturnValue = false
|
||||
roomProxyMock.powerLevelsReturnValue = .success(powerLevelsMock)
|
||||
@@ -246,8 +246,8 @@ final class RoomScreenViewModelTests {
|
||||
ongoingCallRoomIDPublisher: .init(.init(nil)),
|
||||
appSettings: appSettings,
|
||||
appHooks: AppHooks(),
|
||||
analyticsService: AnalyticsServiceMock.default,
|
||||
userIndicatorController: UserIndicatorControllerMock.default)
|
||||
analyticsService: AnalyticsServiceMock(.init()),
|
||||
userIndicatorController: UserIndicatorControllerMock())
|
||||
self.viewModel = viewModel
|
||||
|
||||
#expect(viewModel.state.roomTitle == "StartingName")
|
||||
@@ -283,8 +283,8 @@ final class RoomScreenViewModelTests {
|
||||
ongoingCallRoomIDPublisher: ongoingCallRoomIDSubject.asCurrentValuePublisher(),
|
||||
appSettings: appSettings,
|
||||
appHooks: AppHooks(),
|
||||
analyticsService: AnalyticsServiceMock.default,
|
||||
userIndicatorController: UserIndicatorControllerMock.default)
|
||||
analyticsService: AnalyticsServiceMock(.init()),
|
||||
userIndicatorController: UserIndicatorControllerMock())
|
||||
self.viewModel = viewModel
|
||||
#expect(viewModel.state.shouldShowCallButton)
|
||||
|
||||
@@ -328,8 +328,8 @@ final class RoomScreenViewModelTests {
|
||||
ongoingCallRoomIDPublisher: .init(.init(nil)),
|
||||
appSettings: appSettings,
|
||||
appHooks: AppHooks(),
|
||||
analyticsService: AnalyticsServiceMock.default,
|
||||
userIndicatorController: UserIndicatorControllerMock.default)
|
||||
analyticsService: AnalyticsServiceMock(.init()),
|
||||
userIndicatorController: UserIndicatorControllerMock())
|
||||
self.viewModel = viewModel
|
||||
viewModel.stop()
|
||||
}
|
||||
@@ -349,8 +349,8 @@ final class RoomScreenViewModelTests {
|
||||
ongoingCallRoomIDPublisher: .init(.init(nil)),
|
||||
appSettings: appSettings,
|
||||
appHooks: AppHooks(),
|
||||
analyticsService: AnalyticsServiceMock.default,
|
||||
userIndicatorController: UserIndicatorControllerMock.default)
|
||||
analyticsService: AnalyticsServiceMock(.init()),
|
||||
userIndicatorController: UserIndicatorControllerMock())
|
||||
self.viewModel = viewModel
|
||||
|
||||
var deferred = deferFulfillment(viewModel.context.$viewState) { state in
|
||||
@@ -383,8 +383,8 @@ final class RoomScreenViewModelTests {
|
||||
ongoingCallRoomIDPublisher: .init(.init(nil)),
|
||||
appSettings: appSettings,
|
||||
appHooks: AppHooks(),
|
||||
analyticsService: AnalyticsServiceMock.default,
|
||||
userIndicatorController: UserIndicatorControllerMock.default)
|
||||
analyticsService: AnalyticsServiceMock(.init()),
|
||||
userIndicatorController: UserIndicatorControllerMock())
|
||||
self.viewModel = viewModel
|
||||
|
||||
var deferred = deferFulfillment(viewModel.context.$viewState) { state in
|
||||
@@ -412,8 +412,8 @@ final class RoomScreenViewModelTests {
|
||||
ongoingCallRoomIDPublisher: .init(.init(nil)),
|
||||
appSettings: appSettings,
|
||||
appHooks: AppHooks(),
|
||||
analyticsService: AnalyticsServiceMock.default,
|
||||
userIndicatorController: UserIndicatorControllerMock.default)
|
||||
analyticsService: AnalyticsServiceMock(.init()),
|
||||
userIndicatorController: UserIndicatorControllerMock())
|
||||
self.viewModel = viewModel
|
||||
|
||||
// Loading state just does not appear at all
|
||||
@@ -432,8 +432,8 @@ final class RoomScreenViewModelTests {
|
||||
ongoingCallRoomIDPublisher: .init(.init(nil)),
|
||||
appSettings: appSettings,
|
||||
appHooks: AppHooks(),
|
||||
analyticsService: AnalyticsServiceMock.default,
|
||||
userIndicatorController: UserIndicatorControllerMock.default)
|
||||
analyticsService: AnalyticsServiceMock(.init()),
|
||||
userIndicatorController: UserIndicatorControllerMock())
|
||||
self.viewModel = viewModel
|
||||
|
||||
let deferred = deferFulfillment(viewModel.context.$viewState) { state in
|
||||
@@ -459,8 +459,8 @@ final class RoomScreenViewModelTests {
|
||||
ongoingCallRoomIDPublisher: .init(.init(nil)),
|
||||
appSettings: appSettings,
|
||||
appHooks: AppHooks(),
|
||||
analyticsService: AnalyticsServiceMock.default,
|
||||
userIndicatorController: UserIndicatorControllerMock.default)
|
||||
analyticsService: AnalyticsServiceMock(.init()),
|
||||
userIndicatorController: UserIndicatorControllerMock())
|
||||
self.viewModel = viewModel
|
||||
|
||||
let deferredInvisible = deferFailure(viewModel.context.$viewState,
|
||||
|
||||
Reference in New Issue
Block a user