-
-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Assert drawables in list items #310
Assert drawables in list items #310
Conversation
Hi @gaelmarhic Just curios, have you tried to something similar to: https://github.com/SchibstedSpain/Barista#custom-assertions but applying it to list items? Maybe we can expand the |
@alorma Thanks for reviewing my PR! |
Hello! For me the solution is fine. @alorma's suggestion would lead to less code, which is always better in terms of maintainability, but as this is a gift, for me it is better than good 😄 The only issue I find is that there isn't a test to check that the assertion fails if the drawable is not found. Could you add it? Thank you so much @gaelmarhic 👍 |
@rocboronat Do you have an example of these kind of tests you are referring to? |
@gaelmarhic I'm out of office for some time... maybe @SmasSive, @alorma or @Sloy could answer that question? In the meantime, if you have the time, look for "fail" in the name of the tests. They are tests that check that your assertion would break if the check doesn't pass. We use to write the optimistic checks, that checks that it goes green when the assertion passes, but not the pessimistic ones, hihi By the way, thanks again for the PR! 😊 |
@rocboronat @alorma |
Hello @gaelmarhic! It has been so difficult to join the whole Barista team in a meeting to talk about this. Sorry for the super late review! We will go merging the PR, but eventually, we'll change your new method's name to Thanks a lot again! 🙇 |
Thank you @rocboronat ! |
This PR consists in adding a function to
BaristaListAssertions
that allows to assert that an item from a list contains a specific drawable.Example:
assertDrawableDisplayedAtPosition(R.id.recycler, 0, R.id.imageview, R.drawable.ic_barista)