Commit Graph
22 Commits
Author SHA1 Message Date
Stefan HallerandClaude Opus 4.8 ad507d67f4 Only prompt to continue a rebase/merge if we started it
When conflicts of an in-progress rebase/merge/cherry-pick/revert are
resolved, lazygit pops up a prompt offering to continue it. This is
helpful when you started the operation in lazygit and resolved the
conflicts in your editor. But it's confusing when the operation was
started outside lazygit — e.g. by a coding agent in another terminal
that resolves the conflicts but hasn't continued yet because it's still
running tests or fixing the build. lazygit would then prompt unbidden.

Track whether the in-progress operation was started from within lazygit,
and only show the prompt in that case. We record this right after running
a merge/rebase step (in CheckMergeOrRebaseWithRefreshOptions, the
subprocess branch of genericMergeCommand, and the custom-command
conflict path), and clear it whenever a refresh observes that no
operation is in progress — which also handles an operation that was
finished or aborted externally.

The conflict-resolution tests start their operation by running git
directly (not through lazygit's UI), so they call the new test helper
Common.PretendMergeOrRebaseStartedInLazygit to have lazygit treat the
operation as its own and still get the prompt.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-03 18:28:07 +02:00
Stefan HallerandClaude Opus 4.8 2614156b2f Add an IsActiveTab assertion for integration tests
Side panel tabs share a window, so which tab is shown is decided by view
z-order rather than the visibility flag (every tab in a window is
'visible'). Tests had no way to assert which tab is actually drawn in
front, which is distinct from which view has keyboard focus. Expose the
window's top view and add an IsActiveTab assertion built on it.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-23 14:15:18 +02:00
Stefan HallerandClaude Opus 4.8 30559f1058 Let integration tests post a focus event
Lazygit reloads changed config files when its terminal window regains
focus, but the test harness had no way to simulate that focus event, so
the live config-reload path was untestable. Add a focus event to the
replayed-events queue and expose it through the GuiDriver as FocusIn.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-23 14:15:18 +02:00
Stefan Haller 196e0a3c17 Copy gocui files into lazygit repo under pkg/gocui
I copied all files except dot files (.github and .gitignore), the _examples
folder, and go.mod/go.sum.

At some point we may want to copy the files back to the gocui repo when other
clients (e.g. lazydocker) want to use the newer versions of them.
2026-04-30 14:29:08 +02:00
Stefan Haller 4f6d3fb592 Don't wait in integration tests when running in headless mode
There's no point in spending time waiting in this case, as nobody can see it.
2024-06-05 14:44:02 +02:00
Stefan Haller 8ca8a43968 Make it mandatory to acknowledge toasts in tests 2024-01-14 17:42:03 +01:00
Stefan Haller 9fa43394fe Make it possible to handle toasts in integration tests
Use it in two selected tests to demonstrate what it looks like.
2024-01-14 17:42:03 +01:00
Simon Whitaker ed1547e0cb Add a Click() primitive to the integration test library 2023-08-07 15:10:28 +01:00
Jesse Duffield 9cc1d65280 Add demo test variant
We're piggybacking on our existing integration test framework to record  demos that we can include in our docs
2023-07-31 22:33:04 +10:00
Jesse Duffield 866e0a618b Add integration test for accordion mode 2023-07-19 22:17:29 +10:00
Jesse Duffield db011d8e34 Improve staging panel integration tests 2023-02-25 11:35:41 +11:00
stk 4d39668743 Undo a change made in #2444 that we didn't end up needing 2023-02-18 09:53:31 +01:00
stk ff2a799200 Make SelectedLine/SelectedLineIdx work in staging/stagingSecondary views
While we try to keep the view's cursor position in sync with the context state's
selectedLineIdx (at least when pressing up or down), there are enough situations
where the two run out of sync; for example when initially opening the view, or
after staging a hunk, or when scrolling the view using the wheel. While it would
be possible to fix these situations to keep them always in sync, it doesn't seem
worth it, because the view's cursor position isn't really used for anything
else. So we rather special-case the SelectedLine/SelectedLineIdx functions of
ViewDriver to query the context state's selectedLineIdx directly if it is a
patch explorer context.
2023-02-15 21:22:11 +01:00
Jesse Duffield ed93e0a2b0 remove dependency on model 2022-12-27 22:52:20 +11:00
Jesse Duffield 010f430d1f add bisect integration test 2022-09-09 20:55:47 -07:00
Jesse Duffield 53979f7cec a more complex custom command test 2022-08-14 20:49:20 +10:00
Jesse Duffield 304d74370e refactor to ensure code doesn't depend on integration code 2022-08-13 13:56:50 +10:00
Jesse Duffield ba96baee32 move code from main into app package to allow test to be injected 2022-08-13 13:55:08 +10:00
Jesse Duffield d890238c7b move input and assert into integration tests package 2022-08-13 13:52:13 +10:00
Jesse Duffield 46ae55f91e introduce gui adapter 2022-08-13 13:51:56 +10:00
Jesse Duffield 225c563c63 another integration test 2022-08-11 21:24:16 +10:00
Jesse Duffield 77881a9c7d add new integration test pattern 2022-08-11 21:24:15 +10:00