summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Haller <stefan@haller-berlin.de>2024-02-24 15:28:11 +0100
committerStefan Haller <stefan@haller-berlin.de>2024-03-02 10:17:58 +0100
commitfd8ce7d779902de3db5b5c9886ef62ed08cae8aa (patch)
treebeced3efef98410e85e4b11db9f241395114a18b
parented34ddc04d24e28603ddf8c7166ffc11db080f01 (diff)
Add test demonstrating the current (undesired) behavior
-rw-r--r--pkg/integration/tests/interactive_rebase/dont_show_branch_heads_for_todo_items.go56
-rw-r--r--pkg/integration/tests/test_list.go1
2 files changed, 57 insertions, 0 deletions
diff --git a/pkg/integration/tests/interactive_rebase/dont_show_branch_heads_for_todo_items.go b/pkg/integration/tests/interactive_rebase/dont_show_branch_heads_for_todo_items.go
new file mode 100644
index 000000000..7c7037188
--- /dev/null
+++ b/pkg/integration/tests/interactive_rebase/dont_show_branch_heads_for_todo_items.go
@@ -0,0 +1,56 @@
+package interactive_rebase
+
+import (
+ "github.com/jesseduffield/lazygit/pkg/config"
+ . "github.com/jesseduffield/lazygit/pkg/integration/components"
+)
+
+var DontShowBranchHeadsForTodoItems = NewIntegrationTest(NewIntegrationTestArgs{
+ Description: "Check that branch heads are shown for normal commits during interactive rebase, but not for todo items",
+ ExtraCmdArgs: []string{},
+ Skip: false,
+ GitVersion: AtLeast("2.38.0"),
+ SetupConfig: func(config *config.AppConfig) {
+ config.AppState.GitLogShowGraph = "never"
+ },
+ SetupRepo: func(shell *Shell) {
+ shell.
+ NewBranch("branch1").
+ CreateNCommits(2).
+ NewBranch("branch2").
+ CreateNCommitsStartingAt(4, 3).
+ NewBranch("branch3").
+ CreateNCommitsStartingAt(3, 7)
+
+ shell.SetConfig("rebase.updateRefs", "true")
+ },
+ Run: func(t *TestDriver, keys config.KeybindingConfig) {
+ t.Views().Commits().
+ Focus().
+ Lines(
+ Contains("CI commit 09"),
+ Contains("CI commit 08"),
+ Contains("CI commit 07"),
+ Contains("CI * commit 06"),
+ Contains("CI commit 05"),
+ Contains("CI commit 04"),
+ Contains("CI commit 03"),
+ Contains("CI * commit 02"),
+ Contains("CI commit 01"),
+ ).
+ NavigateToLine(Contains("commit 04")).
+ Press(keys.Universal.Edit).
+ Lines(
+ Contains("pick").Contains("CI commit 09"),
+ Contains("pick").Contains("CI commit 08"),
+ Contains("pick").Contains("CI commit 07"),
+ Contains("update-ref").Contains("branch2"),
+ Contains("pick").Contains("CI * commit 06"), // the star is undesired here; it's confusing because of the update-ref right above
+ Contains("pick").Contains("CI commit 05"),
+ Contains("CI <-- YOU ARE HERE --- commit 04"),
+ Contains("CI commit 03"),
+ Contains("CI * commit 02"), // this star is fine though
+ Contains("CI commit 01"),
+ )
+ },
+})
diff --git a/pkg/integration/tests/test_list.go b/pkg/integration/tests/test_list.go
index e4efef40a..e26a0731f 100644
--- a/pkg/integration/tests/test_list.go
+++ b/pkg/integration/tests/test_list.go
@@ -162,6 +162,7 @@ var tests = []*components.IntegrationTest{
interactive_rebase.AmendHeadCommitDuringRebase,
interactive_rebase.AmendMerge,
interactive_rebase.AmendNonHeadCommitDuringRebase,
+ interactive_rebase.DontShowBranchHeadsForTodoItems,
interactive_rebase.DropTodoCommitWithUpdateRef,
interactive_rebase.DropWithCustomCommentChar,
interactive_rebase.EditFirstCommit,