summaryrefslogtreecommitdiffstats
path: root/pkg/integration/tests/interactive_rebase
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/integration/tests/interactive_rebase')
-rw-r--r--pkg/integration/tests/interactive_rebase/edit_range_select_outside_rebase.go51
-rw-r--r--pkg/integration/tests/interactive_rebase/mid_rebase_range_select.go21
2 files changed, 51 insertions, 21 deletions
diff --git a/pkg/integration/tests/interactive_rebase/edit_range_select_outside_rebase.go b/pkg/integration/tests/interactive_rebase/edit_range_select_outside_rebase.go
new file mode 100644
index 000000000..4ff2a8c83
--- /dev/null
+++ b/pkg/integration/tests/interactive_rebase/edit_range_select_outside_rebase.go
@@ -0,0 +1,51 @@
+package interactive_rebase
+
+import (
+ "github.com/jesseduffield/lazygit/pkg/config"
+ . "github.com/jesseduffield/lazygit/pkg/integration/components"
+ "github.com/jesseduffield/lazygit/pkg/integration/tests/shared"
+)
+
+var EditRangeSelectOutsideRebase = NewIntegrationTest(NewIntegrationTestArgs{
+ Description: "Select a range of commits to edit outside of a rebase",
+ ExtraCmdArgs: []string{},
+ Skip: false,
+ GitVersion: AtLeast("2.22.0"), // first version that supports the --rebase-merges option
+ SetupConfig: func(config *config.AppConfig) {},
+ SetupRepo: func(shell *Shell) {
+ shared.CreateMergeCommit(shell)
+ },
+ Run: func(t *TestDriver, keys config.KeybindingConfig) {
+ t.Views().Commits().
+ Focus().
+ TopLines(
+ Contains("Merge branch 'second-change-branch' into first-change-branch").IsSelected(),
+ ).
+ Press(keys.Universal.RangeSelectDown).
+ Press(keys.Universal.RangeSelectDown).
+ Press(keys.Universal.RangeSelectDown).
+ Press(keys.Universal.RangeSelectDown).
+ Press(keys.Universal.RangeSelectDown).
+ Lines(
+ Contains("CI ⏣─╮ Merge branch 'second-change-branch' into first-change-branch").IsSelected(),
+ Contains("CI │ ◯ * second-change-branch unrelated change").IsSelected(),
+ Contains("CI │ ◯ second change").IsSelected(),
+ Contains("CI ◯ │ first change").IsSelected(),
+ Contains("CI ◯─╯ * original").IsSelected(),
+ Contains("CI ◯ three").IsSelected(),
+ Contains("CI ◯ two"),
+ Contains("CI ◯ one"),
+ ).
+ Press(keys.Universal.Edit).
+ Lines(
+ Contains("merge CI Merge branch 'second-change-branch' into first-change-branch").IsSelected(),
+ Contains("edit CI first change").IsSelected(),
+ Contains("edit CI * second-change-branch unrelated change").IsSelected(),
+ Contains("edit CI second change").IsSelected(),
+ Contains("edit CI * original").IsSelected(),
+ Contains(" CI ◯ <-- YOU ARE HERE --- three").IsSelected(),
+ Contains(" CI ◯ two"),
+ Contains(" CI ◯ one"),
+ )
+ },
+})
diff --git a/pkg/integration/tests/interactive_rebase/mid_rebase_range_select.go b/pkg/integration/tests/interactive_rebase/mid_rebase_range_select.go
index 6dcb12ea6..c94b63295 100644
--- a/pkg/integration/tests/interactive_rebase/mid_rebase_range_select.go
+++ b/pkg/integration/tests/interactive_rebase/mid_rebase_range_select.go
@@ -20,27 +20,6 @@ var MidRebaseRangeSelect = NewIntegrationTest(NewIntegrationTestArgs{
TopLines(
Contains("commit 10").IsSelected(),
).
- NavigateToLine(Contains("commit 07")).
- Press(keys.Universal.RangeSelectDown).
- TopLines(
- Contains("commit 10"),
- Contains("commit 09"),
- Contains("commit 08"),
- Contains("commit 07").IsSelected(),
- Contains("commit 06").IsSelected(),
- Contains("commit 05"),
- Contains("commit 04"),
- ).
- // Verify we can't perform an edit on multiple commits (it's not supported
- // yet)
- Press(keys.Universal.Edit).
- Tap(func() {
- // This ought to be a toast but I'm too lazy to implement that right now.
- t.ExpectPopup().Alert().
- Title(Equals("Error")).
- Content(Contains("Action does not support range selection, please select a single item")).
- Confirm()
- }).
NavigateToLine(Contains("commit 05")).
// Start a rebase
Press(keys.Universal.Edit).