diff --git a/pkg/integration/tests/bisect/check_out_branch_before_bisecting.go b/pkg/integration/tests/bisect/check_out_branch_before_bisecting.go new file mode 100644 index 000000000..b9e7d2bbf --- /dev/null +++ b/pkg/integration/tests/bisect/check_out_branch_before_bisecting.go @@ -0,0 +1,62 @@ +package bisect + +import ( + "github.com/jesseduffield/lazygit/pkg/config" + . "github.com/jesseduffield/lazygit/pkg/integration/components" +) + +var CheckOutBranchBeforeBisecting = NewIntegrationTest(NewIntegrationTestArgs{ + Description: "Check out a different branch after marking a commit as good, but before marking one as bad", + ExtraCmdArgs: []string{}, + Skip: false, + SetupRepo: func(shell *Shell) { + shell. + CreateNCommits(3). + NewBranch("feature"). + CreateNCommitsStartingAt(3, 4). + Checkout("master") + }, + SetupConfig: func(cfg *config.AppConfig) { + cfg.GetUserConfig().Git.Log.ShowGraph = "never" + }, + Run: func(t *TestDriver, keys config.KeybindingConfig) { + t.Views().Commits(). + Focus(). + SelectedLine(Contains("CI commit-03")). + Press(keys.Commits.ViewBisectOptions). + Tap(func() { + t.ExpectPopup().Menu().Title(Equals("Bisect")).Select(MatchesRegexp(`Mark .* as good`)).Confirm() + }). + Lines( + Contains("CI commit-03").Contains("<-- good"), + Contains("CI commit-02"), + Contains("CI commit-01"), + ) + + t.Views().Branches(). + Focus(). + NavigateToLine(Contains("feature")). + PressPrimaryAction(). + Lines( + Contains("* feature"), + Contains("master"), + ) + + t.Views().Commits(). + /* EXPECTED: + Lines( + Contains("CI commit-06"), + Contains("CI commit-05"), + Contains("CI commit-04"), + Contains("CI commit-03").Contains("<-- good"), + Contains("CI commit-02"), + Contains("CI commit-01"), + ) + ACTUAL: */ + Lines( + Contains("CI commit-03").Contains("<-- good"), + Contains("CI commit-02"), + Contains("CI commit-01"), + ) + }, +}) diff --git a/pkg/integration/tests/test_list.go b/pkg/integration/tests/test_list.go index 3fab3959d..15aa27ea5 100644 --- a/pkg/integration/tests/test_list.go +++ b/pkg/integration/tests/test_list.go @@ -36,6 +36,7 @@ import ( var tests = []*components.IntegrationTest{ bisect.Basic, + bisect.CheckOutBranchBeforeBisecting, bisect.ChooseTerms, bisect.FromOtherBranch, bisect.SelectCurrentCommit,