|
| 1 | +package interactive_rebase |
| 2 | + |
| 3 | +import ( |
| 4 | + "github.com/jesseduffield/lazygit/pkg/config" |
| 5 | + . "github.com/jesseduffield/lazygit/pkg/integration/components" |
| 6 | +) |
| 7 | + |
| 8 | +var InteractiveRebaseWithConflictForEditCommand = NewIntegrationTest(NewIntegrationTestArgs{ |
| 9 | + Description: "Rebase a branch interactively, and edit a commit that will conflict", |
| 10 | + ExtraCmdArgs: []string{}, |
| 11 | + Skip: false, |
| 12 | + SetupConfig: func(cfg *config.AppConfig) {}, |
| 13 | + SetupRepo: func(shell *Shell) { |
| 14 | + shell.EmptyCommit("initial commit") |
| 15 | + shell.CreateFileAndAdd("file.txt", "master content") |
| 16 | + shell.Commit("master commit") |
| 17 | + shell.NewBranchFrom("branch", "master^") |
| 18 | + shell.CreateNCommits(3) |
| 19 | + shell.CreateFileAndAdd("file.txt", "branch content") |
| 20 | + shell.Commit("this will conflict") |
| 21 | + }, |
| 22 | + Run: func(t *TestDriver, keys config.KeybindingConfig) { |
| 23 | + t.Views().Commits(). |
| 24 | + Focus(). |
| 25 | + Lines( |
| 26 | + Contains("this will conflict").IsSelected(), |
| 27 | + Contains("commit 03"), |
| 28 | + Contains("commit 02"), |
| 29 | + Contains("commit 01"), |
| 30 | + Contains("initial commit"), |
| 31 | + ) |
| 32 | + |
| 33 | + t.Views().Branches(). |
| 34 | + Focus(). |
| 35 | + NavigateToLine(Contains("master")). |
| 36 | + Press(keys.Branches.RebaseBranch) |
| 37 | + |
| 38 | + t.ExpectPopup().Menu(). |
| 39 | + Title(Equals("Rebase 'branch'")). |
| 40 | + Select(Contains("Interactive rebase")). |
| 41 | + Confirm() |
| 42 | + |
| 43 | + t.Views().Commits(). |
| 44 | + IsFocused(). |
| 45 | + NavigateToLine(Contains("this will conflict")). |
| 46 | + Press(keys.Universal.Edit) |
| 47 | + |
| 48 | + t.Common().ContinueRebase() |
| 49 | + t.ExpectPopup().Menu(). |
| 50 | + Title(Equals("Conflicts!")). |
| 51 | + Cancel() |
| 52 | + |
| 53 | + t.Views().Commits(). |
| 54 | + Lines( |
| 55 | + Contains("edit").Contains("<-- CONFLICT --- this will conflict").IsSelected(), |
| 56 | + Contains("commit 03"), |
| 57 | + Contains("commit 02"), |
| 58 | + Contains("commit 01"), |
| 59 | + Contains("master commit"), |
| 60 | + Contains("initial commit"), |
| 61 | + ) |
| 62 | + }, |
| 63 | +}) |
0 commit comments