mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-31 14:24:25 +03:00
Add integration tests for rebasing to the initial commit
This commit is contained in:
@ -0,0 +1,39 @@
|
||||
package interactive_rebase
|
||||
|
||||
import (
|
||||
"github.com/jesseduffield/lazygit/pkg/config"
|
||||
. "github.com/jesseduffield/lazygit/pkg/integration/components"
|
||||
)
|
||||
|
||||
var RewordFirstCommit = NewIntegrationTest(NewIntegrationTestArgs{
|
||||
Description: "Rewords the first commit, just to show that it's possible",
|
||||
ExtraCmdArgs: "",
|
||||
Skip: false,
|
||||
SetupConfig: func(config *config.AppConfig) {},
|
||||
SetupRepo: func(shell *Shell) {
|
||||
shell.
|
||||
CreateNCommits(2)
|
||||
},
|
||||
Run: func(t *TestDriver, keys config.KeybindingConfig) {
|
||||
t.Views().Commits().
|
||||
Focus().
|
||||
Lines(
|
||||
Contains("commit 02"),
|
||||
Contains("commit 01"),
|
||||
).
|
||||
NavigateToListItem(Contains("commit 01")).
|
||||
Press(keys.Commits.RenameCommit).
|
||||
Tap(func() {
|
||||
t.ExpectPopup().Prompt().
|
||||
Title(Equals("reword commit")).
|
||||
InitialText(Equals("commit 01")).
|
||||
Clear().
|
||||
Type("renamed 01").
|
||||
Confirm()
|
||||
}).
|
||||
Lines(
|
||||
Contains("commit 02"),
|
||||
Contains("renamed 01"),
|
||||
)
|
||||
},
|
||||
})
|
Reference in New Issue
Block a user