diff --git a/pkg/integration/tests/interactive_rebase/interactive_rebase_with_conflict_for_edit_command.go b/pkg/integration/tests/interactive_rebase/interactive_rebase_with_conflict_for_edit_command.go new file mode 100644 index 000000000..fd09dfe3c --- /dev/null +++ b/pkg/integration/tests/interactive_rebase/interactive_rebase_with_conflict_for_edit_command.go @@ -0,0 +1,63 @@ +package interactive_rebase + +import ( + "github.com/jesseduffield/lazygit/pkg/config" + . "github.com/jesseduffield/lazygit/pkg/integration/components" +) + +var InteractiveRebaseWithConflictForEditCommand = NewIntegrationTest(NewIntegrationTestArgs{ + Description: "Rebase a branch interactively, and edit a commit that will conflict", + ExtraCmdArgs: []string{}, + Skip: false, + SetupConfig: func(cfg *config.AppConfig) {}, + SetupRepo: func(shell *Shell) { + shell.EmptyCommit("initial commit") + shell.CreateFileAndAdd("file.txt", "master content") + shell.Commit("master commit") + shell.NewBranchFrom("branch", "master^") + shell.CreateNCommits(3) + shell.CreateFileAndAdd("file.txt", "branch content") + shell.Commit("this will conflict") + }, + Run: func(t *TestDriver, keys config.KeybindingConfig) { + t.Views().Commits(). + Focus(). + Lines( + Contains("this will conflict").IsSelected(), + Contains("commit 03"), + Contains("commit 02"), + Contains("commit 01"), + Contains("initial commit"), + ) + + t.Views().Branches(). + Focus(). + NavigateToLine(Contains("master")). + Press(keys.Branches.RebaseBranch) + + t.ExpectPopup().Menu(). + Title(Equals("Rebase 'branch'")). + Select(Contains("Interactive rebase")). + Confirm() + + t.Views().Commits(). + IsFocused(). + NavigateToLine(Contains("this will conflict")). + Press(keys.Universal.Edit) + + t.Common().ContinueRebase() + t.ExpectPopup().Menu(). + Title(Equals("Conflicts!")). + Cancel() + + t.Views().Commits(). + Lines( + Contains("edit").Contains("<-- CONFLICT --- this will conflict").IsSelected(), + Contains("commit 03"), + Contains("commit 02"), + Contains("commit 01"), + Contains("master commit"), + Contains("initial commit"), + ) + }, +}) diff --git a/pkg/integration/tests/test_list.go b/pkg/integration/tests/test_list.go index 0d4980d88..7db3f55dd 100644 --- a/pkg/integration/tests/test_list.go +++ b/pkg/integration/tests/test_list.go @@ -250,6 +250,7 @@ var tests = []*components.IntegrationTest{ interactive_rebase.FixupFirstCommit, interactive_rebase.FixupSecondCommit, interactive_rebase.InteractiveRebaseOfCopiedBranch, + interactive_rebase.InteractiveRebaseWithConflictForEditCommand, interactive_rebase.MidRebaseRangeSelect, interactive_rebase.Move, interactive_rebase.MoveAcrossBranchBoundaryOutsideRebase,