Skip to content

Commit 286e5f4

Browse files
committed
Fix clicking multiple times in an integration test
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.
1 parent 052974b commit 286e5f4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pkg/gui/gui_driver.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ func (self *GuiDriver) Click(x, y int) {
5757
0,
5858
)
5959
self.waitTillIdle()
60+
self.gui.g.ReplayedEvents.MouseEvents <- gocui.NewTcellMouseEventWrapper(
61+
tcell.NewEventMouse(x, y, tcell.ButtonNone, 0),
62+
0,
63+
)
64+
self.waitTillIdle()
6065
}
6166

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

0 commit comments

Comments
 (0)