Skip to content

Commit

Permalink
Fix a logic error in test when picking which item to tap
Browse files Browse the repository at this point in the history
It was finding the child before changing to the desired directory!
  • Loading branch information
andydotxyz committed Oct 10, 2024
1 parent d85a96d commit bb4cc42
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions dialog/file_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,10 @@ func TestShowFileSave(t *testing.T) {
assert.Equal(t, "(Parent)", item.name)
assert.True(t, save.Disabled())

abs, _ := filepath.Abs("./testdata/")
dir, _ := storage.ListerForURI(storage.NewFileURI(abs))
saver.SetLocation(dir)

var target *fileDialogItem
id := -1
for i, icon := range objects {
Expand All @@ -354,9 +358,6 @@ func TestShowFileSave(t *testing.T) {
return
}

abs, _ := filepath.Abs("./testdata/")
dir, _ := storage.ListerForURI(storage.NewFileURI(abs))
saver.SetLocation(dir)
saver.dialog.files.(*widget.GridWrap).Select(id)
assert.Equal(t, target.location.Name(), nameEntry.Text)
assert.False(t, save.Disabled())
Expand Down

0 comments on commit bb4cc42

Please sign in to comment.