jesseduffield.lazygit/pkg/integration/tests/ui/range_select_with_autoscroll.go
2026-09-14 13:50:03 +02:00

38 lines
995 B
Go

package ui
import (
"fmt"
"github.com/jesseduffield/lazygit/pkg/config"
. "github.com/jesseduffield/lazygit/pkg/integration/components"
)
var RangeSelectWithAutoscroll = NewIntegrationTest(NewIntegrationTestArgs{
Description: "Keep scrolling while creating a range selection at the panel edge",
ExtraCmdArgs: []string{},
Skip: false,
Width: 120,
Height: 30,
SetupConfig: func(config *config.AppConfig) {
config.GetUserConfig().Gui.UseHunkModeInDiffView = false
},
SetupRepo: func(shell *Shell) {
shell.CreateNCommits(40)
fileContent := "base\n"
shell.CreateFileAndAdd("file1", fileContent)
for i := 1; i <= 40; i++ {
fileContent += fmt.Sprintf("line %d\n", i)
}
shell.UpdateFile("file1", fileContent)
},
Run: func(t *TestDriver, keys config.KeybindingConfig) {
t.Views().Branches().Focus()
t.Views().Commits().
ClickAndHold(1, 0).
MouseMoveToBottom(1).
OriginYAtLeast(3).
SelectedLineIdxAtLeast(3).
MouseRelease()
},
})