delba/Tactile

Testing Tactile methods

kalmurzayev opened this issue · 1 comments

Hi! What is the best way to test logic passed to .tap() or .pinch() methods? How to programmatically trigger those callbacks?

delba commented

Hi @kalmurzayev ! The pinch and tap methods are just creating vanilla UIPinchGestureRecognizer and UITapGestureRecognizer under the hood.
You can trigger them in tests to check the callbacks are called (see https://medium.com/@borutt/unit-testing-gesture-recognizers-b55444884864 for instance)