Add a test for dragging commits past the edges of the commits view

Dragging the first commit above the view, or the last commit below the
end of the list, must not offer to drop them there, because that
wouldn't move them anywhere.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Stefan HallerandClaude Opus 5.5 committed 2026-11-12 15:26:39 +01:00
1 parent b57061ebeb
commit fe9b3cc768
2 files changed
+53

No files matched your search

@@ -0,0 +1,52 @@
package interactive_rebase
import (
"github.com/jesseduffield/lazygit/pkg/config"
. "github.com/jesseduffield/lazygit/pkg/integration/components"
)
var DragToReorderPastTheEdges = NewIntegrationTest(NewIntegrationTestArgs{
Description: "Dragging the first commit above the view, or the last one below the list, doesn't move it",
ExtraCmdArgs: []string{},
Skip: false,
SetupConfig: func(config *config.AppConfig) {},
SetupRepo: func(shell *Shell) {
shell.CreateNCommits(3)
},
Run: func(t *TestDriver, keys config.KeybindingConfig) {
t.Views().Commits().
Focus().
Lines(
Contains("commit-03").IsSelected(),
Contains("commit-02"),
Contains("commit-01"),
).
ClickAndHold(1, 0).
MouseMove(1, -1).
Lines(
Contains("commit-03").IsSelected(),
Contains("commit-02"),
Contains("commit-01"),
).
MouseRelease().
Lines(
Contains("commit-03").IsSelected(),
Contains("commit-02"),
Contains("commit-01"),
).
NavigateToLine(Contains("commit-01")).
ClickAndHold(1, 2).
MouseMove(1, 3).
Lines(
Contains("commit-03"),
Contains("commit-02"),
Contains("commit-01").IsSelected(),
).
MouseRelease().
Lines(
Contains("commit-03"),
Contains("commit-02"),
Contains("commit-01").IsSelected(),
)
},
})
+1
View File
@@ -368,6 +368,7 @@ var tests = []*components.IntegrationTest{
interactive_rebase.DragKeepsSelectionHighlighted,
interactive_rebase.DragToReorder,
interactive_rebase.DragToReorderInRebase,
interactive_rebase.DragToReorderPastTheEdges,
interactive_rebase.DragToReorderWithAutoscroll,
interactive_rebase.DropCommitInCopiedBranchWithUpdateRef,
interactive_rebase.DropMergeCommit,