This is how I subscribe for tap action on UIButton
:
_ = mainView.loginButton.rx.tap.subscribe { _ in
//this is not called at all
}
and now I need to force that action to check if my dependencies work great, but subscribe handler is not called.
func testRouterDidCallWithError() {
let view = LoginView()
let controller = LoginViewController(view: view)
controller.loadView()
view.loginButton.sendActions(for: .touchUpInside) //here is the point
XCTAssertTrue(router.alertWasCalled)
}
Aucun commentaire:
Enregistrer un commentaire