Skip to content

Commit

Permalink
Wait for idle scroll state before asserting positions
Browse files Browse the repository at this point in the history
  • Loading branch information
rubensousa committed Aug 11, 2024
1 parent a492c72 commit 350b382
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ import com.rubensousa.dpadrecyclerview.ChildAlignment
import com.rubensousa.dpadrecyclerview.ParentAlignment
import com.rubensousa.dpadrecyclerview.test.TestAdapterConfiguration
import com.rubensousa.dpadrecyclerview.test.TestLayoutConfiguration
import com.rubensousa.dpadrecyclerview.test.helpers.*
import com.rubensousa.dpadrecyclerview.test.helpers.getRecyclerViewBounds
import com.rubensousa.dpadrecyclerview.test.helpers.getRelativeItemViewBounds
import com.rubensousa.dpadrecyclerview.test.helpers.selectPosition
import com.rubensousa.dpadrecyclerview.test.helpers.waitForIdleScrollState
import com.rubensousa.dpadrecyclerview.test.tests.DpadRecyclerViewTest
import com.rubensousa.dpadrecyclerview.testfixtures.LayoutConfig
import com.rubensousa.dpadrecyclerview.testfixtures.RowLayout
Expand Down Expand Up @@ -103,12 +106,14 @@ class ReverseHorizontalTest : DpadRecyclerViewTest() {
repeat(5) {
KeyEvents.pressLeft()
row.scrollLeft()
waitForIdleScrollState()
assertChildrenPositions(row)
}

repeat(5) {
KeyEvents.pressRight()
row.scrollRight()
waitForIdleScrollState()
assertChildrenPositions(row)
}
}
Expand Down

0 comments on commit 350b382

Please sign in to comment.