:question: :red_circle: :test_tube: Compose Testi...
# compose
t
🔴 🧪 Compose Testing : How do I test if the exception is thrown or not? See more details in the SO thread
z
I’m not sure if there’s a non-hacky way to do this, but stepping back: why do you need to test that an exception is thrown from a click handler? If your click action performs some action that can fail, just write a test for that failure case without involving the view layer.
t
@Zach Klippenstein (he/him) [MOD] this is a simplified version of a complex scenario. basically, whatever error we throw, doesn’t get caught in the instrumentation test
z
That seems like an odd thing to test to me. Typically a UI test will check for error handling by checking for some sort of error message or other special state displayed in the UI, not looking for individual exceptions.
t
Sounds fare 🤔 I think I need to remove this exception test from UI test.
I’m not sure if there’s a non-hacky way to do this
the`ExpectedException`  way works, but the 
none()
 method of it is deprecated. The recommended method is to use 
assertThrows
 which is not working at the moment.