diff --git a/pkg/integration/tests/interactive_rebase/drag_to_reorder_past_the_edges.go b/pkg/integration/tests/interactive_rebase/drag_to_reorder_past_the_edges.go new file mode 100644 index 000000000..6aa8d6b6b --- /dev/null +++ b/pkg/integration/tests/interactive_rebase/drag_to_reorder_past_the_edges.go @@ -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(), + ) + }, +}) diff --git a/pkg/integration/tests/test_list.go b/pkg/integration/tests/test_list.go index 36c7475b1..9d49a1f96 100644 --- a/pkg/integration/tests/test_list.go +++ b/pkg/integration/tests/test_list.go @@ -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,