1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-28 16:02:01 +03:00

a more complex custom command test

This commit is contained in:
Jesse Duffield
2022-08-14 20:13:39 +10:00
parent 9c0d860980
commit 53979f7cec
17 changed files with 263 additions and 43 deletions

View File

@ -2,37 +2,37 @@ package interactive_rebase
import (
"github.com/jesseduffield/lazygit/pkg/config"
"github.com/jesseduffield/lazygit/pkg/integration/components"
. "github.com/jesseduffield/lazygit/pkg/integration/components"
)
var One = components.NewIntegrationTest(components.NewIntegrationTestArgs{
var One = NewIntegrationTest(NewIntegrationTestArgs{
Description: "Begins an interactive rebase, then fixups, drops, and squashes some commits",
ExtraCmdArgs: "",
Skip: false,
SetupConfig: func(config *config.AppConfig) {},
SetupRepo: func(shell *components.Shell) {
SetupRepo: func(shell *Shell) {
shell.
CreateNCommits(5) // these will appears at commit 05, 04, 04, down to 01
},
Run: func(shell *components.Shell, input *components.Input, assert *components.Assert, keys config.KeybindingConfig) {
Run: func(shell *Shell, input *Input, assert *Assert, keys config.KeybindingConfig) {
input.SwitchToCommitsWindow()
assert.CurrentViewName("commits")
input.NavigateToListItemContainingText("commit 02")
input.PressKeys(keys.Universal.Edit)
assert.SelectedLineContains("YOU ARE HERE")
assert.MatchSelectedLine(Contains("YOU ARE HERE"))
input.PreviousItem()
input.PressKeys(keys.Commits.MarkCommitAsFixup)
assert.SelectedLineContains("fixup")
assert.MatchSelectedLine(Contains("fixup"))
input.PreviousItem()
input.PressKeys(keys.Universal.Remove)
assert.SelectedLineContains("drop")
assert.MatchSelectedLine(Contains("drop"))
input.PreviousItem()
input.PressKeys(keys.Commits.SquashDown)
assert.SelectedLineContains("squash")
assert.MatchSelectedLine(Contains("squash"))
input.ContinueRebase()