Skip to content

Commit

Permalink
Fix clicking multiple times in an integration test
Browse files Browse the repository at this point in the history
So far we only had tests that called Click() only once. If you have a test that
calls Click twice (we'll add one in the next commit), you'll notice that the
second click is interpreted as a drag because the mouse button wasn't released
in between. Fix this by sending a "mouse-up" event after the click.
  • Loading branch information
stefanhaller committed Oct 18, 2024
1 parent 052974b commit 286e5f4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/gui/gui_driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ func (self *GuiDriver) Click(x, y int) {
0,
)
self.waitTillIdle()
self.gui.g.ReplayedEvents.MouseEvents <- gocui.NewTcellMouseEventWrapper(
tcell.NewEventMouse(x, y, tcell.ButtonNone, 0),
0,
)
self.waitTillIdle()
}

// wait until lazygit is idle (i.e. all processing is done) before continuing
Expand Down

0 comments on commit 286e5f4

Please sign in to comment.