diff --git a/pkg/integration/tests/bisect/select_current_commit_in_long_range.go b/pkg/integration/tests/bisect/select_current_commit_in_long_range.go new file mode 100644 index 000000000..e3ad8aeba --- /dev/null +++ b/pkg/integration/tests/bisect/select_current_commit_in_long_range.go @@ -0,0 +1,31 @@ +package bisect + +import ( + "fmt" + + "github.com/jesseduffield/lazygit/pkg/config" + . "github.com/jesseduffield/lazygit/pkg/integration/components" +) + +var SelectCurrentCommitInLongRange = NewIntegrationTest(NewIntegrationTestArgs{ + Description: "Select the current bisect commit when it is further down than the commits that we load at first", + ExtraCmdArgs: []string{}, + Skip: false, + SetupRepo: func(shell *Shell) { + for i := range 700 { + shell.EmptyCommit(fmt.Sprintf("commit %03d", i+1)) + } + shell.StartBisect("HEAD", "HEAD~699") + }, + SetupConfig: func(cfg *config.AppConfig) { + cfg.GetUserConfig().Git.Log.ShowGraph = "never" + }, + Run: func(t *TestDriver, keys config.KeybindingConfig) { + t.Views().Commits(). + Focus(). + /* EXPECTED: + SelectedLine(Contains("<-- current")) + ACTUAL: */ + SelectedLine(Contains("commit 700")) + }, +}) diff --git a/pkg/integration/tests/test_list.go b/pkg/integration/tests/test_list.go index 15aa27ea5..decdd2b73 100644 --- a/pkg/integration/tests/test_list.go +++ b/pkg/integration/tests/test_list.go @@ -40,6 +40,7 @@ var tests = []*components.IntegrationTest{ bisect.ChooseTerms, bisect.FromOtherBranch, bisect.SelectCurrentCommit, + bisect.SelectCurrentCommitInLongRange, bisect.Skip, branch.CheckoutAutostash, branch.CheckoutByName,