Skip to content

Commit

Permalink
Extra test to cover issue 1737
Browse files Browse the repository at this point in the history
New test TestEntry_CursorColumn_Wrap2 to address the bug  (1737)[fyne-io#1737]
  • Loading branch information
aayush420 committed Jan 11, 2021
1 parent a92dd07 commit ae3e375
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions widget/entry_test.go
Expand Up @@ -109,6 +109,22 @@ func TestEntry_CursorColumn_Wrap(t *testing.T) {
assert.Equal(t, 1, entry.CursorColumn)
}

func TestEntry_CursorColumn_Wrap2(t *testing.T) {
entry := widget.NewMultiLineEntry()
entry.Wrapping = fyne.TextWrapWord
entry.Resize(fyne.NewSize(64, 64))
entry.SetText("1234")
entry.CursorColumn = 3
test.Type(entry, "a")
test.Type(entry, "b")
test.Type(entry, "c")
assert.Equal(t, 1, entry.CursorColumn)
assert.Equal(t, 1, entry.CursorRow)
w := test.NewWindow(entry)
w.Resize(fyne.NewSize(70, 70))
test.AssertImageMatches(t, "dummyfile.png", w.Canvas().Capture())
}

func TestEntry_CursorPasswordRevealer(t *testing.T) {
pr := widget.NewPasswordEntry().ActionItem.(desktop.Cursorable)
assert.Equal(t, desktop.DefaultCursor, pr.Cursor())
Expand Down

0 comments on commit ae3e375

Please sign in to comment.