forked from jesseduffield/lazygit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test demonstrating the current (undesired) behavior
- Loading branch information
1 parent
ed34ddc
commit fd8ce7d
Showing
2 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
56 changes: 56 additions & 0 deletions
56
pkg/integration/tests/interactive_rebase/dont_show_branch_heads_for_todo_items.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"), | ||
) | ||
}, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters