mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-29 23:17:32 +02:00
Add test for rewording a merge commit
This currently fails with an error.
This commit is contained in:
parent
b02441cdca
commit
50b2aa5843
@ -0,0 +1,56 @@
|
||||
package interactive_rebase
|
||||
|
||||
import (
|
||||
"github.com/jesseduffield/lazygit/pkg/config"
|
||||
. "github.com/jesseduffield/lazygit/pkg/integration/components"
|
||||
)
|
||||
|
||||
var RewordMergeCommit = NewIntegrationTest(NewIntegrationTestArgs{
|
||||
Description: "Rewords a merge commit which is not the current head commit",
|
||||
ExtraCmdArgs: []string{},
|
||||
Skip: false,
|
||||
SetupConfig: func(config *config.AppConfig) {},
|
||||
SetupRepo: func(shell *Shell) {
|
||||
shell.
|
||||
EmptyCommit("base").
|
||||
NewBranch("first-branch").
|
||||
CreateFileAndAdd("file1.txt", "content").
|
||||
Commit("one").
|
||||
Checkout("master").
|
||||
Merge("first-branch").
|
||||
NewBranch("second-branch").
|
||||
EmptyCommit("two")
|
||||
},
|
||||
Run: func(t *TestDriver, keys config.KeybindingConfig) {
|
||||
t.Views().Commits().
|
||||
Focus().
|
||||
Lines(
|
||||
Contains("CI ◯ two").IsSelected(),
|
||||
Contains("CI ⏣─╮ Merge branch 'first-branch'"),
|
||||
Contains("CI │ ◯ one"),
|
||||
Contains("CI ◯─╯ base"),
|
||||
).
|
||||
SelectNextItem().
|
||||
Press(keys.Commits.RenameCommit).
|
||||
Tap(func() {
|
||||
t.ExpectPopup().CommitMessagePanel().
|
||||
Title(Equals("Reword commit")).
|
||||
InitialText(Equals("Merge branch 'first-branch'")).
|
||||
Clear().
|
||||
Type("renamed merge").
|
||||
Confirm()
|
||||
}).
|
||||
/* EXPECTED:
|
||||
Lines(
|
||||
Contains("CI ◯ two"),
|
||||
Contains("CI ⏣─╮ renamed merge").IsSelected(),
|
||||
Contains("CI │ ◯ one"),
|
||||
Contains("CI ◯ ╯ base"),
|
||||
)
|
||||
ACTUAL: */
|
||||
Tap(func() {
|
||||
t.ExpectPopup().Alert().Title(Equals("Error")).
|
||||
Content(Contains("error: 'edit' does not accept merge commits"))
|
||||
})
|
||||
},
|
||||
})
|
@ -275,6 +275,7 @@ var tests = []*components.IntegrationTest{
|
||||
interactive_rebase.RewordFirstCommit,
|
||||
interactive_rebase.RewordLastCommit,
|
||||
interactive_rebase.RewordLastCommitOfStackedBranch,
|
||||
interactive_rebase.RewordMergeCommit,
|
||||
interactive_rebase.RewordYouAreHereCommit,
|
||||
interactive_rebase.RewordYouAreHereCommitWithEditor,
|
||||
interactive_rebase.ShowExecTodos,
|
||||
|
Loading…
x
Reference in New Issue
Block a user