forked from openedx/openedx-app-ios
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix social auth banner after whats new screen (#106)
* chore: transfer post login data through WhatNew screen * chore: fixes after merge * chore: refactor after merge * chore: fixed tests and regenerate mocks * chore: added default post login data * chore: little refactor --------- Co-authored-by: Anton Yarmolenko <[email protected]>
- Loading branch information
Showing
19 changed files
with
194 additions
and
211 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
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
48 changes: 24 additions & 24 deletions
48
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 |
---|---|---|
|
@@ -40,7 +40,7 @@ final class SignInViewModelTests: XCTestCase { | |
await viewModel.login(username: "", password: "") | ||
|
||
Verify(interactor, 0, .login(username: .any, password: .any)) | ||
Verify(router, 0, .showMainOrWhatsNewScreen(sourceScreen: .any, authMethod: .any)) | ||
Verify(router, 0, .showMainOrWhatsNewScreen(sourceScreen: .any, postLoginData: .any)) | ||
|
||
XCTAssertEqual(viewModel.errorMessage, AuthLocalization.Error.invalidEmailAddressOrUsername) | ||
XCTAssertEqual(viewModel.isShowProgress, false) | ||
|
@@ -63,7 +63,7 @@ final class SignInViewModelTests: XCTestCase { | |
await viewModel.login(username: "[email protected]", password: "") | ||
|
||
Verify(interactor, 0, .login(username: .any, password: .any)) | ||
Verify(router, 0, .showMainOrWhatsNewScreen(sourceScreen: .any, authMethod: .any)) | ||
Verify(router, 0, .showMainOrWhatsNewScreen(sourceScreen: .any, postLoginData: .any)) | ||
|
||
XCTAssertEqual(viewModel.errorMessage, AuthLocalization.Error.invalidPasswordLenght) | ||
XCTAssertEqual(viewModel.isShowProgress, false) | ||
|
@@ -91,7 +91,7 @@ final class SignInViewModelTests: XCTestCase { | |
|
||
Verify(interactor, 1, .login(username: .any, password: .any)) | ||
Verify(analytics, .userLogin(method: .any)) | ||
Verify(router, 1, .showMainOrWhatsNewScreen(sourceScreen: .any, authMethod: .any)) | ||
Verify(router, 1, .showMainOrWhatsNewScreen(sourceScreen: .any, postLoginData: .any)) | ||
|
||
XCTAssertEqual(viewModel.errorMessage, nil) | ||
XCTAssertEqual(viewModel.isShowProgress, true) | ||
|
@@ -123,7 +123,7 @@ final class SignInViewModelTests: XCTestCase { | |
|
||
Verify(interactor, 1, .login(externalToken: .any, backend: .any)) | ||
Verify(analytics, .userLogin(method: .any)) | ||
Verify(router, 1, .showMainOrWhatsNewScreen(sourceScreen: .any, authMethod: .any)) | ||
Verify(router, 1, .showMainOrWhatsNewScreen(sourceScreen: .any, postLoginData: .any)) | ||
|
||
XCTAssertEqual(viewModel.errorMessage, nil) | ||
XCTAssertEqual(viewModel.isShowProgress, true) | ||
|
@@ -159,7 +159,7 @@ final class SignInViewModelTests: XCTestCase { | |
await viewModel.login(with: result) | ||
|
||
Verify(interactor, 1, .login(externalToken: .any, backend: .any)) | ||
Verify(router, 0, .showMainOrWhatsNewScreen(sourceScreen: .any, authMethod: .any)) | ||
Verify(router, 0, .showMainOrWhatsNewScreen(sourceScreen: .any, postLoginData: .any)) | ||
|
||
XCTAssertEqual(viewModel.errorMessage, validationErrorMessage) | ||
XCTAssertEqual(viewModel.isShowProgress, false) | ||
|
@@ -189,7 +189,7 @@ final class SignInViewModelTests: XCTestCase { | |
await viewModel.login(username: "[email protected]", password: "password123") | ||
|
||
Verify(interactor, 1, .login(username: .any, password: .any)) | ||
Verify(router, 0, .showMainOrWhatsNewScreen(sourceScreen: .any, authMethod: .any)) | ||
Verify(router, 0, .showMainOrWhatsNewScreen(sourceScreen: .any, postLoginData: .any)) | ||
|
||
XCTAssertEqual(viewModel.errorMessage, validationErrorMessage) | ||
XCTAssertEqual(viewModel.isShowProgress, false) | ||
|
@@ -215,7 +215,7 @@ final class SignInViewModelTests: XCTestCase { | |
await viewModel.login(username: "[email protected]", password: "password123") | ||
|
||
Verify(interactor, 1, .login(username: .any, password: .any)) | ||
Verify(router, 0, .showMainOrWhatsNewScreen(sourceScreen: .any, authMethod: .any)) | ||
Verify(router, 0, .showMainOrWhatsNewScreen(sourceScreen: .any, postLoginData: .any)) | ||
|
||
XCTAssertEqual(viewModel.errorMessage, CoreLocalization.Error.invalidCredentials) | ||
XCTAssertEqual(viewModel.isShowProgress, false) | ||
|
@@ -241,7 +241,7 @@ final class SignInViewModelTests: XCTestCase { | |
await viewModel.login(username: "[email protected]", password: "password123") | ||
|
||
Verify(interactor, 1, .login(username: .any, password: .any)) | ||
Verify(router, 0, .showMainOrWhatsNewScreen(sourceScreen: .any, authMethod: .any)) | ||
Verify(router, 0, .showMainOrWhatsNewScreen(sourceScreen: .any, postLoginData: .any)) | ||
|
||
XCTAssertEqual(viewModel.errorMessage, CoreLocalization.Error.unknownError) | ||
XCTAssertEqual(viewModel.isShowProgress, false) | ||
|
@@ -269,7 +269,7 @@ final class SignInViewModelTests: XCTestCase { | |
await viewModel.login(username: "[email protected]", password: "password123") | ||
|
||
Verify(interactor, 1, .login(username: .any, password: .any)) | ||
Verify(router, 0, .showMainOrWhatsNewScreen(sourceScreen: .any, authMethod: .any)) | ||
Verify(router, 0, .showMainOrWhatsNewScreen(sourceScreen: .any, postLoginData: .any)) | ||
|
||
XCTAssertEqual(viewModel.errorMessage, CoreLocalization.Error.slowOrNoInternetConnection) | ||
XCTAssertEqual(viewModel.isShowProgress, false) | ||
|
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
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.