Skip to content

Commit

Permalink
add test for ScrollToOffset/GetScrollOffset
Browse files Browse the repository at this point in the history
  • Loading branch information
dweymouth committed Feb 18, 2024
1 parent 925c4f1 commit be7222e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions widget/list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,16 @@ func TestList_ScrollToTop(t *testing.T) {
assert.Equal(t, offset, list.scroller.Offset.Y)
}

func TestList_ScrollOffset(t *testing.T) {
list := createList(1000)

offset := float32(25)
list.ScrollToOffset(25)
assert.Equal(t, offset, list.offsetY)
assert.Equal(t, offset, list.scroller.Offset.Y)
assert.Equal(t, offset, list.GetScrollOffset())
}

func TestList_Selection(t *testing.T) {
list := createList(1000)
children := list.scroller.Content.(*fyne.Container).Layout.(*listLayout).children
Expand Down

0 comments on commit be7222e

Please sign in to comment.