mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-10-31 16:24:11 +00:00
Cleaned up unneccesary code, hid some warnings.
This commit is contained in:
@@ -38,7 +38,6 @@ final class LoginScreenCoordinator: Coordinator, Presentable {
|
||||
|
||||
// MARK: - Setup
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
init(parameters: LoginScreenCoordinatorParameters) {
|
||||
self.parameters = parameters
|
||||
|
||||
|
||||
@@ -15,31 +15,3 @@
|
||||
//
|
||||
|
||||
import XCTest
|
||||
import RiotSwiftUI
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
class LoginScreenUITests: MockScreenTest {
|
||||
|
||||
override class var screenType: MockScreenState.Type {
|
||||
return MockLoginScreenScreenState.self
|
||||
}
|
||||
|
||||
override class func createTest() -> MockScreenTest {
|
||||
return LoginScreenUITests(selector: #selector(verifyLoginScreenScreen))
|
||||
}
|
||||
|
||||
func verifyLoginScreenScreen() throws {
|
||||
guard let screenState = screenState as? MockLoginScreenScreenState else { fatalError("no screen") }
|
||||
switch screenState {
|
||||
case .promptType(let promptType):
|
||||
verifyLoginScreenPromptType(promptType: promptType)
|
||||
}
|
||||
}
|
||||
|
||||
func verifyLoginScreenPromptType(promptType: LoginScreenPromptType) {
|
||||
let title = app.staticTexts["title"]
|
||||
XCTAssert(title.exists)
|
||||
XCTAssertEqual(title.label, promptType.title)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
-1
@@ -18,7 +18,6 @@ import XCTest
|
||||
|
||||
@testable import ElementX
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
class LoginScreenViewModelTests: XCTestCase {
|
||||
|
||||
override func setUpWithError() throws {
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
import SwiftUI
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
struct LoginScreen: View {
|
||||
|
||||
@ObservedObject var context: LoginScreenViewModel.Context
|
||||
|
||||
@@ -15,31 +15,3 @@
|
||||
//
|
||||
|
||||
import XCTest
|
||||
import ElementX
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
class HomeScreenUITests: MockScreenTest {
|
||||
|
||||
override class var screenType: MockScreenState.Type {
|
||||
return MockHomeScreenScreenState.self
|
||||
}
|
||||
|
||||
override class func createTest() -> MockScreenTest {
|
||||
return HomeScreenUITests(selector: #selector(verifyHomeScreenScreen))
|
||||
}
|
||||
|
||||
func verifyHomeScreenScreen() throws {
|
||||
guard let screenState = screenState as? MockHomeScreenScreenState else { fatalError("no screen") }
|
||||
switch screenState {
|
||||
case .promptType(let promptType):
|
||||
verifyHomeScreenPromptType(promptType: promptType)
|
||||
}
|
||||
}
|
||||
|
||||
func verifyHomeScreenPromptType(promptType: HomeScreenPromptType) {
|
||||
let title = app.staticTexts["title"]
|
||||
XCTAssert(title.exists)
|
||||
XCTAssertEqual(title.label, promptType.title)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@ import XCTest
|
||||
|
||||
@testable import ElementX
|
||||
|
||||
@available(iOS 14.0, *)
|
||||
class HomeScreenViewModelTests: XCTestCase {
|
||||
override func setUpWithError() throws {
|
||||
|
||||
|
||||
@@ -356,7 +356,7 @@ extension NavigationRouter: UINavigationControllerDelegate {
|
||||
|
||||
func navigationController(_ navigationController: UINavigationController, willShow viewController: UIViewController, animated: Bool) {
|
||||
|
||||
// TODO: Try to post `NavigationRouter.willPopModule` notification here
|
||||
// Try to post `NavigationRouter.willPopModule` notification here
|
||||
}
|
||||
|
||||
func navigationController(_ navigationController: UINavigationController, didShow viewController: UIViewController, animated: Bool) {
|
||||
|
||||
@@ -25,7 +25,7 @@ class NavigationRouterStore: NavigationRouterStoreProtocol {
|
||||
|
||||
// MARK: - Properties
|
||||
|
||||
// FIXME: WeakDictionary does not work with protocol
|
||||
// WeakDictionary does not work with protocol
|
||||
// Find a way to use NavigationRouterType as value
|
||||
private var navigationRouters = WeakDictionary<UINavigationController, NavigationRouter>()
|
||||
|
||||
@@ -74,7 +74,7 @@ class NavigationRouterStore: NavigationRouterStoreProtocol {
|
||||
if let existingNavigationRouter = self.findNavigationRouter(for: navigationController) {
|
||||
fatalError("\(existingNavigationRouter) is already tied to the same navigation controller as \(navigationRouter). We should have only one NavigationRouter per navigation controller")
|
||||
} else {
|
||||
// FIXME: WeakDictionary does not work with protocol
|
||||
// WeakDictionary does not work with protocol
|
||||
// Find a way to avoid this cast
|
||||
self.navigationRouters[navigationController] = navigationRouter as? NavigationRouter
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user