nalexn / ViewInspector

Runtime introspection and unit testing of SwiftUI views
MIT License
2.09k stars 145 forks source link

Xcode 15.0 - Type mismatch: ButtonAction is not () -> () #269

Closed ccaraccia closed 8 months ago

ccaraccia commented 8 months ago

I have a test that passes with no issue in Xcode 14.3 and it fails in Xcode 15.0. The test is fairly easy

let exp = sut.inspection.inspect(after: 0.2) { view in
            try view.find(viewWithTag: "back_button").button().tap()
            XCTAssert(self.myMock.myMethodWasCalled)
        }
ViewHosting.host(view: sut.environmentObject(myMock1).environmentObject(myMock2))
wait(for: [exp], timeout: 3.0)

The error we are seeing is: Type mismatch: ButtonAction is not () -> ()

Thanks for the help

ccaraccia commented 8 months ago

This was not an issue. The latest version of the package solves it.