android:layout_alignParentEnd="true"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
+ android:contentDescription="@string/dlg_close"
android:src="@drawable/ic_suggestion_close_button"/>
</RelativeLayout>
android:layout_alignParentEnd="true"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
+ android:contentDescription="@string/dlg_close"
android:src="@drawable/ic_suggestion_close_button"/>
</RelativeLayout>
}
@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");
setupSuggestions(mContext, suggestions);