DrawableMatcher should correctly match provided Drawable objects
Closed this issue · 3 comments
ahampe commented
Steps to reproduce:
- Attempt to match a drawable in a screen with
hasDrawable(@DrawableRes resId: Int)
and observe test success. - Attempt to match same drawable with
hasDrawable(drawable: Drawable)
, passing in a loaded drawable from the previous resource ID. The test will fail.
Observed Results:
Failure with exception android.content.res.Resources$NotFoundException: Resource ID #0xffffffff
It seems like DrawableMatcher.matchesSafely
mixes up the assignment of the drawable parameter. It should probably be assigned to the expectedDrawable
, not the convertDrawable
.
ahampe commented
I forked the project and have a branch with this fix, plus relevant tests. Should I put in a PR?
Unlimity commented
Fix is merged. Closing this issue.