An advanced Ethereum/EVM mobile wallet
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
alpha-wallet-ios/TrustTests/Coordinators/AppCoordinatorTests.swift

87 lines
2.6 KiB

// Copyright SIX DAY LLC. All rights reserved.
import XCTest
@testable import Trust
class AppCoordinatorTests: XCTestCase {
func testStart() {
let coordinator = AppCoordinator(
window: UIWindow(),
keystore: FakeKeystore()
)
coordinator.start()
XCTAssertTrue(coordinator.navigationController.viewControllers[0] is WelcomeViewController)
}
func testStartWithAccounts() {
let coordinator = AppCoordinator(
window: UIWindow(),
keystore: FakeKeystore(
wallets: [.make()]
)
)
coordinator.start()
XCTAssertEqual(1, coordinator.coordinators.count)
XCTAssertTrue(coordinator.navigationController.viewControllers[0] is UITabBarController)
}
func testReset() {
let coordinator = AppCoordinator(
window: UIWindow(),
keystore: FakeKeystore(
wallets: [.make()]
)
)
coordinator.start()
coordinator.reset()
XCTAssertTrue(coordinator.navigationController.viewControllers[0] is WelcomeViewController)
}
func testStartWelcomeWalletCoordinator() {
let coordinator = AppCoordinator(
window: UIWindow(),
keystore: FakeKeystore(),
navigationController: FakeNavigationController()
)
coordinator.start()
coordinator.showInitialWalletCoordinator(entryPoint: .createInstantWallet)
XCTAssertTrue(coordinator.navigationController.viewControllers[0] is WelcomeViewController)
}
func testImportWalletCoordinator() {
let coordinator = AppCoordinator(
window: UIWindow(),
keystore: FakeKeystore(
wallets: [.make()]
),
navigationController: FakeNavigationController()
)
coordinator.start()
coordinator.showInitialWalletCoordinator(entryPoint: .importWallet)
XCTAssertTrue((coordinator.navigationController.presentedViewController as? UINavigationController)?.viewControllers[0] is ImportWalletViewController)
}
func testShowTransactions() {
let coordinator = AppCoordinator(
window: UIWindow(),
keystore: FakeKeystore(),
navigationController: FakeNavigationController()
)
coordinator.start()
coordinator.showTransactions(for: .make())
XCTAssertEqual(1, coordinator.coordinators.count)
XCTAssertTrue(coordinator.navigationController.viewControllers[0] is UITabBarController)
}
}