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:
Doug
2026-05-22 17:34:35 +01:00
committed by GitHub
parent edd7130a97
commit 08d02001bf
146 changed files with 540 additions and 546 deletions
@@ -279,9 +279,9 @@ final class AuthenticationStartScreenViewModelTests {
supportsPasswordLogin: Bool = true,
availableSecrets: ClassicAppAccount.AvailableSecrets = .complete) async {
// Manually create a configuration as the default homeserver address setting is immutable.
client = ClientSDKMock(configuration: .init(oAuthLoginURL: supportsOAuth ? "https://account.company.com/authorize" : nil,
supportsOAuthCreatePrompt: false,
supportsPasswordLogin: supportsPasswordLogin))
client = ClientSDKMock(.init(oAuthLoginURL: supportsOAuth ? "https://account.company.com/authorize" : nil,
supportsOAuthCreatePrompt: false,
supportsPasswordLogin: supportsPasswordLogin))
// Map both the server name and the homeserver URL so fallback lookups work.
let homeserverClients: [String: ClientSDKMock] = ["company.com": client,
"https://matrix.company.com": client]
@@ -295,8 +295,8 @@ final class AuthenticationStartScreenViewModelTests {
notificationCenter = NotificationCenter()
clientFactory = AuthenticationClientFactoryMock(configuration: configuration)
authenticationService = AuthenticationService(userSessionStore: UserSessionStoreMock(configuration: .init()),
clientFactory = AuthenticationClientFactoryMock(configuration)
authenticationService = AuthenticationService(userSessionStore: UserSessionStoreMock(.init()),
encryptionKeyProvider: EncryptionKeyProvider(),
classicAppManager: classicAppManager,
clientFactory: clientFactory,
@@ -310,7 +310,7 @@ final class AuthenticationStartScreenViewModelTests {
isBugReportServiceEnabled: true,
appMediator: AppMediatorMock(),
appSettings: appSettings,
mediaProvider: MediaProviderMock(configuration: .init()),
mediaProvider: MediaProviderMock(.init()),
notificationCenter: notificationCenter,
userIndicatorController: UserIndicatorControllerMock())