mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-08-28 02:24:49 -05:00
I'm not a skilled UI designer, so I suspect there may be even better options, but it's definitely already better than the raw ASCII "---" we had before. Put the line only at the beginning because it looks bad if the line after the label is misaligned when labels don't have the same width (e.g. "Remote" vs. "Local" in the divergence view).
72 lines
1.8 KiB
Go
72 lines
1.8 KiB
Go
package interactive_rebase
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/jesseduffield/lazygit/pkg/config"
|
|
. "github.com/jesseduffield/lazygit/pkg/integration/components"
|
|
)
|
|
|
|
const (
|
|
BASE_BRANCH = "base-branch"
|
|
TOP_BRANCH = "top-branch"
|
|
BASE_COMMIT = "base-commit"
|
|
TOP_COMMIT = "top-commit"
|
|
)
|
|
|
|
var AdvancedInteractiveRebase = NewIntegrationTest(NewIntegrationTestArgs{
|
|
Description: "It begins an interactive rebase and verifies to have the possibility of editing the commits of the branch before proceeding with the actual rebase",
|
|
ExtraCmdArgs: []string{},
|
|
SetupConfig: func(config *config.AppConfig) {},
|
|
SetupRepo: func(shell *Shell) {
|
|
shell.
|
|
NewBranch(BASE_BRANCH).
|
|
EmptyCommit(BASE_COMMIT).
|
|
NewBranch(TOP_BRANCH).
|
|
EmptyCommit(TOP_COMMIT)
|
|
},
|
|
Run: func(t *TestDriver, keys config.KeybindingConfig) {
|
|
t.Views().Commits().
|
|
Focus().
|
|
Lines(
|
|
Contains(TOP_COMMIT),
|
|
Contains(BASE_COMMIT),
|
|
)
|
|
|
|
t.Views().Branches().
|
|
Focus().
|
|
NavigateToLine(Contains(BASE_BRANCH)).
|
|
Press(keys.Branches.RebaseBranch)
|
|
|
|
t.ExpectPopup().Menu().
|
|
Title(Equals(fmt.Sprintf("Rebase '%s'", TOP_BRANCH))).
|
|
Select(Contains("Interactive rebase")).
|
|
Confirm()
|
|
t.Views().Commits().
|
|
IsFocused().
|
|
Lines(
|
|
Contains("─── Pending rebase todos"),
|
|
Contains(TOP_COMMIT),
|
|
Contains("─── Commits"),
|
|
Contains(BASE_COMMIT),
|
|
).
|
|
NavigateToLine(Contains(TOP_COMMIT)).
|
|
Press(keys.Universal.Edit).
|
|
Lines(
|
|
Contains("─── Pending rebase todos"),
|
|
Contains(TOP_COMMIT).Contains("edit"),
|
|
Contains("─── Commits"),
|
|
Contains(BASE_COMMIT),
|
|
).
|
|
Tap(func() {
|
|
t.Common().ContinueRebase()
|
|
}).
|
|
Lines(
|
|
Contains("─── Pending rebase todos"),
|
|
Contains("─── Commits"),
|
|
Contains(TOP_COMMIT),
|
|
Contains(BASE_COMMIT),
|
|
)
|
|
},
|
|
})
|