|
| 1 | +package branch |
| 2 | + |
| 3 | +import ( |
| 4 | + "github.com/jesseduffield/lazygit/pkg/config" |
| 5 | + . "github.com/jesseduffield/lazygit/pkg/integration/components" |
| 6 | + "github.com/jesseduffield/lazygit/pkg/integration/tests/shared" |
| 7 | +) |
| 8 | + |
| 9 | +var RebaseCancelOnConflict = NewIntegrationTest(NewIntegrationTestArgs{ |
| 10 | + Description: "Rebase onto another branch, cancel when there are conflicts.", |
| 11 | + ExtraCmdArgs: []string{}, |
| 12 | + Skip: false, |
| 13 | + SetupConfig: func(config *config.AppConfig) {}, |
| 14 | + SetupRepo: func(shell *Shell) { |
| 15 | + shared.MergeConflictsSetup(shell) |
| 16 | + }, |
| 17 | + Run: func(t *TestDriver, keys config.KeybindingConfig) { |
| 18 | + t.Views().Commits().TopLines( |
| 19 | + Contains("first change"), |
| 20 | + Contains("original"), |
| 21 | + ) |
| 22 | + |
| 23 | + t.Views().Branches(). |
| 24 | + Focus(). |
| 25 | + Lines( |
| 26 | + Contains("first-change-branch"), |
| 27 | + Contains("second-change-branch"), |
| 28 | + Contains("original-branch"), |
| 29 | + ). |
| 30 | + SelectNextItem(). |
| 31 | + Press(keys.Branches.RebaseBranch) |
| 32 | + |
| 33 | + t.ExpectPopup().Menu(). |
| 34 | + Title(Equals("Rebase 'first-change-branch' onto 'second-change-branch'")). |
| 35 | + Select(Contains("Simple rebase")). |
| 36 | + Confirm() |
| 37 | + |
| 38 | + t.ExpectPopup().Menu(). |
| 39 | + Title(Equals("Conflicts!")). |
| 40 | + Select(Contains("Abort the rebase")). |
| 41 | + Cancel() |
| 42 | + |
| 43 | + t.Views().Branches(). |
| 44 | + IsFocused() |
| 45 | + |
| 46 | + t.Views().Files(). |
| 47 | + Lines( |
| 48 | + Contains("UU file"), |
| 49 | + ) |
| 50 | + }, |
| 51 | +}) |
0 commit comments