1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-04-21 12:16:54 +02:00
lazygit/pkg/integration/tests/demo/interactive_rebase.go
Jesse Duffield 621229bb09 Default to half-screen mode when filtering files or using the git-arg CLI arg
It should have been half-screen from the get-go. I think I just used
full-screen to make demos look nicer. Now that we have a CLI arg for the
screen mode we can make use of that in the demos.
2025-01-02 16:10:58 +11:00

63 lines
1.6 KiB
Go

package demo
import (
"github.com/jesseduffield/lazygit/pkg/config"
. "github.com/jesseduffield/lazygit/pkg/integration/components"
)
var InteractiveRebase = NewIntegrationTest(NewIntegrationTestArgs{
Description: "Interactive rebase",
ExtraCmdArgs: []string{"log", "--screen-mode=full"},
Skip: false,
IsDemo: true,
SetupConfig: func(config *config.AppConfig) {
setDefaultDemoConfig(config)
},
SetupRepo: func(shell *Shell) {
shell.CreateRepoHistory()
shell.NewBranch("feature/demo")
shell.CreateNCommitsWithRandomMessages(10)
shell.CloneIntoRemote("origin")
shell.SetBranchUpstream("feature/demo", "origin/feature/demo")
},
Run: func(t *TestDriver, keys config.KeybindingConfig) {
t.SetCaptionPrefix("Interactive rebase")
t.Wait(1000)
t.Views().Commits().
IsFocused().
Press(keys.Commits.StartInteractiveRebase).
PressFast(keys.Universal.RangeSelectDown).
PressFast(keys.Universal.RangeSelectDown).
Press(keys.Commits.MarkCommitAsFixup).
PressFast(keys.Commits.MoveDownCommit).
PressFast(keys.Commits.MoveDownCommit).
Delay().
SelectNextItem().
SelectNextItem().
Press(keys.Universal.Remove).
SelectNextItem().
Press(keys.Commits.SquashDown).
Press(keys.Universal.CreateRebaseOptionsMenu).
Tap(func() {
t.ExpectPopup().Menu().
Title(Contains("Rebase options")).
Select(Contains("continue")).
Confirm()
}).
SetCaptionPrefix("Push to remote").
Press(keys.Universal.NextScreenMode).
Press(keys.Universal.Push).
Tap(func() {
t.ExpectPopup().Confirmation().
Title(Contains("Force push")).
Content(AnyString()).
Confirm()
})
},
})