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:
@@ -13,37 +13,37 @@ import MatrixRustSDKMocks
|
||||
extension AuthenticationClientFactoryMock {
|
||||
struct Configuration {
|
||||
var homeserverClients = [
|
||||
"matrix.org": ClientSDKMock(configuration: .init()),
|
||||
"https://matrix-client.matrix.org": ClientSDKMock(configuration: .init()),
|
||||
"example.com": ClientSDKMock(configuration: .init(serverAddress: "example.com",
|
||||
homeserverURL: "https://matrix.example.com",
|
||||
slidingSyncVersion: .native,
|
||||
oAuthLoginURL: nil,
|
||||
supportsOAuthCreatePrompt: false,
|
||||
supportsPasswordLogin: true)),
|
||||
"company.com": ClientSDKMock(configuration: .init(serverAddress: "company.com",
|
||||
homeserverURL: "https://matrix.company.com",
|
||||
slidingSyncVersion: .native,
|
||||
oAuthLoginURL: "https://auth.company.com/login",
|
||||
supportsOAuthCreatePrompt: false,
|
||||
supportsPasswordLogin: false)),
|
||||
"server.net": ClientSDKMock(configuration: .init(serverAddress: "server.net",
|
||||
homeserverURL: "https://matrix.server.net",
|
||||
slidingSyncVersion: .native,
|
||||
oAuthLoginURL: nil,
|
||||
supportsOAuthCreatePrompt: false,
|
||||
supportsPasswordLogin: false)),
|
||||
"secure.gov": ClientSDKMock(configuration: .init(serverAddress: "secure.gov",
|
||||
homeserverURL: "https://ess.secure.gov",
|
||||
slidingSyncVersion: .native,
|
||||
oAuthLoginURL: "https://auth.secure.gov/login",
|
||||
supportsOAuthCreatePrompt: false,
|
||||
supportsPasswordLogin: false,
|
||||
elementWellKnown: "{\"version\":1,\"enforce_element_pro\":true}"))
|
||||
"matrix.org": ClientSDKMock(.init()),
|
||||
"https://matrix-client.matrix.org": ClientSDKMock(.init()),
|
||||
"example.com": ClientSDKMock(.init(serverAddress: "example.com",
|
||||
homeserverURL: "https://matrix.example.com",
|
||||
slidingSyncVersion: .native,
|
||||
oAuthLoginURL: nil,
|
||||
supportsOAuthCreatePrompt: false,
|
||||
supportsPasswordLogin: true)),
|
||||
"company.com": ClientSDKMock(.init(serverAddress: "company.com",
|
||||
homeserverURL: "https://matrix.company.com",
|
||||
slidingSyncVersion: .native,
|
||||
oAuthLoginURL: "https://auth.company.com/login",
|
||||
supportsOAuthCreatePrompt: false,
|
||||
supportsPasswordLogin: false)),
|
||||
"server.net": ClientSDKMock(.init(serverAddress: "server.net",
|
||||
homeserverURL: "https://matrix.server.net",
|
||||
slidingSyncVersion: .native,
|
||||
oAuthLoginURL: nil,
|
||||
supportsOAuthCreatePrompt: false,
|
||||
supportsPasswordLogin: false)),
|
||||
"secure.gov": ClientSDKMock(.init(serverAddress: "secure.gov",
|
||||
homeserverURL: "https://ess.secure.gov",
|
||||
slidingSyncVersion: .native,
|
||||
oAuthLoginURL: "https://auth.secure.gov/login",
|
||||
supportsOAuthCreatePrompt: false,
|
||||
supportsPasswordLogin: false,
|
||||
elementWellKnown: "{\"version\":1,\"enforce_element_pro\":true}"))
|
||||
]
|
||||
}
|
||||
|
||||
convenience init(configuration: Configuration) {
|
||||
convenience init(_ configuration: Configuration) {
|
||||
self.init()
|
||||
|
||||
makeClientHomeserverAddressSessionDirectoriesPassphraseClientSessionDelegateAppSettingsAppHooksClosure = { address, _, _, _, _, _ in
|
||||
|
||||
Reference in New Issue
Block a user