File tree Expand file tree Collapse file tree 2 files changed +11
-5
lines changed
indicator-fast-scroll/src
androidTest/java/com/reddit/indicatorfastscroll
main/java/com/reddit/indicatorfastscroll Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -38,18 +38,24 @@ class Tests {
38
38
TestActivity .ListItem (" K" ),
39
39
TestActivity .ListItem (" L" ),
40
40
TestActivity .ListItem (" M" ),
41
- TestActivity .ListItem (" N" )
41
+ TestActivity .ListItem (" N" ),
42
+ TestActivity .ListItem (" O" , android.R .drawable.ic_dialog_info)
42
43
)
43
44
val expectedTexts = listOf (
44
45
" A" , " C\n D" , " F\n G\n H" , " J\n K\n L\n M\n N"
45
46
)
47
+ val expectedIconCount = items.count { it.iconRes != null }
46
48
47
49
activity.runOnUiThread {
48
50
activity.presentData(items)
49
51
}
50
- onView(withId(R .id.test_fastscroller)).check(matches(
51
- allOf(expectedTexts.map { withChild(withText(it)) })
52
- ))
52
+ onView(withId(R .id.test_fastscroller))
53
+ .check(matches(
54
+ allOf(expectedTexts.map { withChild(withText(it)) })
55
+ ))
56
+ .check(matches(
57
+ hasChildCount(expectedTexts.size + expectedIconCount)
58
+ ))
53
59
}
54
60
55
61
@Test
Original file line number Diff line number Diff line change @@ -233,7 +233,7 @@ class FastScrollerView @JvmOverloads constructor(
233
233
val viewCreators = ArrayList < () -> View > ()
234
234
itemIndicators.run {
235
235
var index = 0
236
- while (index < lastIndex) {
236
+ while (index <= lastIndex) {
237
237
@Suppress(" UNCHECKED_CAST" )
238
238
val textIndicatorsBatch = subList(index, size)
239
239
.takeWhile { it is FastScrollItemIndicator .Text }
You can’t perform that action at this time.
0 commit comments