-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
130dbf9
commit 1cbee62
Showing
8 changed files
with
290 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 58 additions & 3 deletions
61
Authorization/AuthorizationTests/AuthorizationMock.generated.swift
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -93,7 +93,33 @@ final class SignInViewModelTests: XCTestCase { | |
XCTAssertEqual(viewModel.errorMessage, nil) | ||
XCTAssertEqual(viewModel.isShowProgress, true) | ||
} | ||
|
||
|
||
func testSSOLoginSuccess() async throws { | ||
let interactor = AuthInteractorProtocolMock() | ||
let router = AuthorizationRouterMock() | ||
let validator = Validator() | ||
let analytics = AuthorizationAnalyticsMock() | ||
let viewModel = SignInViewModel( | ||
interactor: interactor, | ||
router: router, | ||
config: ConfigMock(), | ||
analytics: analytics, | ||
validator: validator, | ||
sourceScreen: .default | ||
) | ||
let user = User(id: 1, username: "username", email: "[email protected]", name: "Name", userAvatar: "") | ||
|
||
Given(interactor, .ssoLogin(title: .any, willReturn: user)) | ||
|
||
await viewModel.ssoLogin(title: "Riyadah") | ||
|
||
Verify(interactor, 1, .ssoLogin(title: .any)) | ||
Verify(router, 1, .showMainOrWhatsNewScreen(sourceScreen: .any)) | ||
|
||
XCTAssertEqual(viewModel.errorMessage, nil) | ||
XCTAssertEqual(viewModel.isShowProgress, true) | ||
} | ||
|
||
func testSocialLoginSuccess() async throws { | ||
let interactor = AuthInteractorProtocolMock() | ||
let router = AuthorizationRouterMock() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.