@@ -34,7 +34,7 @@ class AuthenticationStartScreenViewModelTests: XCTestCase {
34
34
// Given a view model that has no provisioning parameters.
35
35
setupViewModel ( )
36
36
XCTAssertEqual ( authenticationService. homeserver. value. loginMode, . unknown)
37
- XCTAssertEqual ( client. urlForOidcOidcConfigurationPromptLoginHintCallsCount , 0 )
37
+ XCTAssertEqual ( client. urlForOidcOidcConfigurationPromptLoginHintDeviceIdCallsCount , 0 )
38
38
39
39
// When tapping any of the buttons on the screen
40
40
let actions : [ ( AuthenticationStartScreenViewAction , AuthenticationStartScreenViewModelAction ) ] = [
@@ -51,7 +51,7 @@ class AuthenticationStartScreenViewModelTests: XCTestCase {
51
51
52
52
// Then the authentication service should not be used yet.
53
53
XCTAssertEqual ( clientBuilderFactory. makeBuilderSessionDirectoriesPassphraseClientSessionDelegateAppSettingsAppHooksCallsCount, 0 )
54
- XCTAssertEqual ( client. urlForOidcOidcConfigurationPromptLoginHintCallsCount , 0 )
54
+ XCTAssertEqual ( client. urlForOidcOidcConfigurationPromptLoginHintDeviceIdCallsCount , 0 )
55
55
XCTAssertEqual ( authenticationService. homeserver. value. loginMode, . unknown)
56
56
}
57
57
}
@@ -60,7 +60,7 @@ class AuthenticationStartScreenViewModelTests: XCTestCase {
60
60
// Given a view model that has been provisioned with a server that supports OIDC.
61
61
setupViewModel ( provisioningParameters: . init( accountProvider: " company.com " , loginHint: " user@company.com " ) )
62
62
XCTAssertEqual ( authenticationService. homeserver. value. loginMode, . unknown)
63
- XCTAssertEqual ( client. urlForOidcOidcConfigurationPromptLoginHintCallsCount , 0 )
63
+ XCTAssertEqual ( client. urlForOidcOidcConfigurationPromptLoginHintDeviceIdCallsCount , 0 )
64
64
65
65
// When tapping the login button the authentication service should be used and the screen
66
66
// should request to continue the flow without any server selection needed.
@@ -69,17 +69,17 @@ class AuthenticationStartScreenViewModelTests: XCTestCase {
69
69
try await deferred. fulfill ( )
70
70
71
71
XCTAssertEqual ( clientBuilderFactory. makeBuilderSessionDirectoriesPassphraseClientSessionDelegateAppSettingsAppHooksCallsCount, 1 )
72
- XCTAssertEqual ( client. urlForOidcOidcConfigurationPromptLoginHintCallsCount , 1 )
73
- XCTAssertEqual ( client. urlForOidcOidcConfigurationPromptLoginHintReceivedArguments ? . prompt, . consent)
74
- XCTAssertEqual ( client. urlForOidcOidcConfigurationPromptLoginHintReceivedArguments ? . loginHint, " user@company.com " )
72
+ XCTAssertEqual ( client. urlForOidcOidcConfigurationPromptLoginHintDeviceIdCallsCount , 1 )
73
+ XCTAssertEqual ( client. urlForOidcOidcConfigurationPromptLoginHintDeviceIdReceivedArguments ? . prompt, . consent)
74
+ XCTAssertEqual ( client. urlForOidcOidcConfigurationPromptLoginHintDeviceIdReceivedArguments ? . loginHint, " user@company.com " )
75
75
XCTAssertEqual ( authenticationService. homeserver. value. loginMode, . oidc( supportsCreatePrompt: false ) )
76
76
}
77
77
78
78
func testProvisionedPasswordState( ) async throws {
79
79
// Given a view model that has been provisioned with a server that does not support OIDC.
80
80
setupViewModel ( provisioningParameters: . init( accountProvider: " company.com " , loginHint: " user@company.com " ) , supportsOIDC: false )
81
81
XCTAssertEqual ( authenticationService. homeserver. value. loginMode, . unknown)
82
- XCTAssertEqual ( client. urlForOidcOidcConfigurationPromptLoginHintCallsCount , 0 )
82
+ XCTAssertEqual ( client. urlForOidcOidcConfigurationPromptLoginHintDeviceIdCallsCount , 0 )
83
83
84
84
// When tapping the login button the authentication service should be used and the screen
85
85
// should request to continue the flow without any server selection needed.
@@ -97,7 +97,7 @@ class AuthenticationStartScreenViewModelTests: XCTestCase {
97
97
setAllowedAccountProviders ( [ " company.com " ] )
98
98
setupViewModel ( )
99
99
XCTAssertEqual ( authenticationService. homeserver. value. loginMode, . unknown)
100
- XCTAssertEqual ( client. urlForOidcOidcConfigurationPromptLoginHintCallsCount , 0 )
100
+ XCTAssertEqual ( client. urlForOidcOidcConfigurationPromptLoginHintDeviceIdCallsCount , 0 )
101
101
102
102
// When tapping the login button the authentication service should be used and the screen
103
103
// should request to continue the flow without any server selection needed.
@@ -106,9 +106,9 @@ class AuthenticationStartScreenViewModelTests: XCTestCase {
106
106
try await deferred. fulfill ( )
107
107
108
108
XCTAssertEqual ( clientBuilderFactory. makeBuilderSessionDirectoriesPassphraseClientSessionDelegateAppSettingsAppHooksCallsCount, 1 )
109
- XCTAssertEqual ( client. urlForOidcOidcConfigurationPromptLoginHintCallsCount , 1 )
110
- XCTAssertEqual ( client. urlForOidcOidcConfigurationPromptLoginHintReceivedArguments ? . prompt, . consent)
111
- XCTAssertEqual ( client. urlForOidcOidcConfigurationPromptLoginHintReceivedArguments ? . loginHint, nil )
109
+ XCTAssertEqual ( client. urlForOidcOidcConfigurationPromptLoginHintDeviceIdCallsCount , 1 )
110
+ XCTAssertEqual ( client. urlForOidcOidcConfigurationPromptLoginHintDeviceIdReceivedArguments ? . prompt, . consent)
111
+ XCTAssertEqual ( client. urlForOidcOidcConfigurationPromptLoginHintDeviceIdReceivedArguments ? . loginHint, nil )
112
112
XCTAssertEqual ( authenticationService. homeserver. value. loginMode, . oidc( supportsCreatePrompt: false ) )
113
113
}
114
114
@@ -117,7 +117,7 @@ class AuthenticationStartScreenViewModelTests: XCTestCase {
117
117
setAllowedAccountProviders ( [ " company.com " ] )
118
118
setupViewModel ( supportsOIDC: false )
119
119
XCTAssertEqual ( authenticationService. homeserver. value. loginMode, . unknown)
120
- XCTAssertEqual ( client. urlForOidcOidcConfigurationPromptLoginHintCallsCount , 0 )
120
+ XCTAssertEqual ( client. urlForOidcOidcConfigurationPromptLoginHintDeviceIdCallsCount , 0 )
121
121
122
122
// When tapping the login button the authentication service should be used and the screen
123
123
// should request to continue the flow without any server selection needed.
0 commit comments