agoda-com/Kakao

DrawableMatcher should correctly match provided Drawable objects

Closed this issue · 3 comments

Steps to reproduce:

  1. Attempt to match a drawable in a screen with hasDrawable(@DrawableRes resId: Int) and observe test success.
  2. 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.

I forked the project and have a branch with this fix, plus relevant tests. Should I put in a PR?

cdsap commented

@ahampe thanks for the interest.
Sure, you can create a PR

Fix is merged. Closing this issue.