-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configure the AuthenticationService later now that we have 2 flows on the start screen. #3316
Conversation
Generated by 🚫 Danger Swift against 5af32d9 |
❌ 1 Tests Failed:
View the top 1 failed tests by shortest run time
To view individual test run time comparison to the main branch, go to the Test Analytics Dashboard |
b6569a9
to
abe1ecb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very very nice cleanup and testing! 👏
Talked about general api design concerns offline, feel free to tackle them in a separate PR if necessary.
|
||
@testable import ElementX | ||
|
||
class AuthenticationServiceTests: XCTestCase { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👏
@@ -107,6 +106,8 @@ final class ServerSelectionScreenCoordinator: CoordinatorProtocol { | |||
viewModel.displayError(.invalidWellKnownAlert(error)) | |||
case .slidingSyncNotAvailable: | |||
viewModel.displayError(.slidingSyncAlert) | |||
case .registrationNotSupported: | |||
viewModel.displayError(.registrationAlert) // TODO: [DOUG] Test me! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(I have this already in a follow-up branch).
|
||
// MARK: - Helpers | ||
|
||
private func setupMocks(clientConfiguration: ClientSDKMock.Configuration = .init()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really nice!
// MARK: - Mocks | ||
|
||
extension AuthenticationService { | ||
static var mock = AuthenticationService(userSessionStore: UserSessionStoreMock(configuration: .init()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙌
@@ -11,5 +11,117 @@ import XCTest | |||
|
|||
@MainActor | |||
class ServerConfirmationScreenViewModelTests: XCTestCase { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implement basic tests for configuration & password login.
abe1ecb
to
5af32d9
Compare
Quality Gate passedIssues Measures |
Merging this as the snapshot failures are emoji provider flakiness. Going to spend some time on these failures now. |
This PR is the first of a series to re-work the authentication flow:
AuthenticationStartScreen
. Instead we do it either when selecting a server, or if this hasn't happened, when continuing to use the default homeserver. (This lines up with how the flow works on Android).ClientSDKMock
.MockAuthenticationService
with the real one in all of our tests.AuthenticationService
andServerConfirmationScreenViewModel
.Fixes #3028 from the perspective of if matrix.org is blocked (although that long timeout still needs addressing if you were to tap continue to try matrix.org in this instance.
More tests to follow, but this PR has already grown larger than I would have liked. Definitely one to review commit-by-commit.