Skip to content

Instantly share code, notes, and snippets.

@eyeezzi
Last active December 12, 2018 23:49
Show Gist options
  • Save eyeezzi/dbe1e75d7fe9025e358d42a5b80505c2 to your computer and use it in GitHub Desktop.
Save eyeezzi/dbe1e75d7fe9025e358d42a5b80505c2 to your computer and use it in GitHub Desktop.
Testing View Controllers
@testable import Shopify_POS
class CustomerDetailsViewControllerTests: PointOfSaleTests {
func testDetailsOfflineDisablesEdit() {
let customerDataProvider = CustomersDataProvider.Mock()
let customerDetails = CustomerDetailsViewController(account: account, customer: createCustomer(), /*...*/ reachability: ReachabilityMock(with: .none))
let navigationController = UINavigationController(rootViewController: customerDetails)
navigationController.view.resize(to: .modal)
verify(navigationController, delay: 1.0)
}
func testDetailsWithActions() {
let customerDetails = CustomerDetailsViewController(account: account, customer: createCustomer(), /*...*/)
let navigationController = UINavigationController(rootViewController: customerDetails)
navigationController.view.resize(to: .modal)
verify(navigationController, delay: 1.0)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment