|
| 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 MoveAcrossBranchBoundaryOutsideRebase = NewIntegrationTest(NewIntegrationTestArgs{ |
| 9 | + Description: "Move a commit across a branch boundary in a stack of branches", |
| 10 | + ExtraCmdArgs: []string{}, |
| 11 | + Skip: false, |
| 12 | + GitVersion: AtLeast("2.38.0"), |
| 13 | + SetupConfig: func(config *config.AppConfig) { |
| 14 | + config.GetUserConfig().Git.MainBranches = []string{"master"} |
| 15 | + config.GetAppState().GitLogShowGraph = "never" |
| 16 | + }, |
| 17 | + SetupRepo: func(shell *Shell) { |
| 18 | + shell. |
| 19 | + CreateNCommits(1). |
| 20 | + NewBranch("branch1"). |
| 21 | + CreateNCommitsStartingAt(2, 2). |
| 22 | + NewBranch("branch2"). |
| 23 | + CreateNCommitsStartingAt(2, 4) |
| 24 | + |
| 25 | + shell.SetConfig("rebase.updateRefs", "true") |
| 26 | + }, |
| 27 | + Run: func(t *TestDriver, keys config.KeybindingConfig) { |
| 28 | + t.Views().Commits(). |
| 29 | + Focus(). |
| 30 | + Lines( |
| 31 | + Contains("CI commit 05").IsSelected(), |
| 32 | + Contains("CI commit 04"), |
| 33 | + Contains("CI * commit 03"), |
| 34 | + Contains("CI commit 02"), |
| 35 | + Contains("CI commit 01"), |
| 36 | + ). |
| 37 | + NavigateToLine(Contains("commit 04")). |
| 38 | + Press(keys.Commits.MoveDownCommit). |
| 39 | + Lines( |
| 40 | + /* EXPECTED: |
| 41 | + Contains("CI commit 05"), |
| 42 | + Contains("CI * commit 03"), |
| 43 | + Contains("CI commit 04").IsSelected(), |
| 44 | + Contains("CI commit 02"), |
| 45 | + Contains("CI commit 01"), |
| 46 | + ACTUAL: */ |
| 47 | + Contains("CI commit 05"), |
| 48 | + Contains("CI * commit 04"), |
| 49 | + Contains("CI commit 03").IsSelected(), |
| 50 | + Contains("CI commit 02"), |
| 51 | + Contains("CI commit 01"), |
| 52 | + ) |
| 53 | + }, |
| 54 | +}) |
0 commit comments