Merge "Add content description to suggestion card close button."

This commit is contained in:
TreeHugger Robot
2018-02-13 11:07:11 +00:00
committed by Android (Google) Code Review
3 changed files with 15 additions and 0 deletions

View File

@@ -294,6 +294,19 @@ public class SuggestionAdapterTest {
verify(drawable).setTint(colorAccent);
}
@Test
public void onBindViewHolder_closeButtonShouldHaveContentDescription()
throws PendingIntent.CanceledException {
final List<Suggestion> suggestions = makeSuggestions("pkg1");
setupSuggestions(mActivity, suggestions);
mSuggestionAdapter.onBindViewHolder(mSuggestionHolder, 0);
assertThat(
mSuggestionHolder.itemView.findViewById(R.id.close_button).getContentDescription())
.isNotNull();
}
@Test
public void setCardLayout_oneCard_shouldSetCardWidthToMatchParent() {
final List<Suggestion> suggestions = makeSuggestions("pkg1");