Skip to content

Commit

Permalink
Merge pull request #217 from Richard-Gist/buildCrash
Browse files Browse the repository at this point in the history
Build crash fix
  • Loading branch information
Tyler-Keith-Thompson authored Nov 5, 2022
2 parents 56f8be0 + 6cc9b80 commit 854fdb8
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,15 @@ final class UIKitInteropTests: XCTestCase, View {

func testPuttingAUIKitViewThatDoesNotTakeInDataInsideASwiftUIWorkflow() async throws {
final class FR1: UIWorkflowItem<Never, Never>, FlowRepresentable {
let nextButton = UIButton()
let nextButtonTag = UUID().hashValue

@objc private func nextPressed() {
proceedInWorkflow()
}

override func viewDidLoad() {
let nextButton = UIButton()
nextButton.tag = nextButtonTag
nextButton.setTitle("Next", for: .normal)
nextButton.setTitleColor(.systemBlue, for: .normal)
nextButton.addTarget(self, action: #selector(nextPressed), for: .touchUpInside)
Expand Down Expand Up @@ -143,8 +145,9 @@ final class UIKitInteropTests: XCTestCase, View {
proceedCalled.fulfill()
}

XCTAssertEqual(vc.nextButton.willRespondToUser, true)
vc.nextButton.simulateTouch()
let nextButton = try XCTUnwrap(vc.view.viewWithTag(vc.nextButtonTag) as? UIButton)
XCTAssertEqual(nextButton.willRespondToUser, true)
nextButton.simulateTouch()

wait(for: [proceedCalled], timeout: TestConstant.timeout)
}
Expand Down

0 comments on commit 854fdb8

Please sign in to comment.