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

Add test for amending a merge commit

This commit is contained in:
Luka Markušić
2022-09-10 17:00:40 +02:00
parent 4c7d363959
commit 0141bbde0e
26 changed files with 78 additions and 1 deletions

View File

@ -0,0 +1,37 @@
package interactive_rebase
import (
"github.com/jesseduffield/lazygit/pkg/config"
. "github.com/jesseduffield/lazygit/pkg/integration/components"
)
var AmendMerge = NewIntegrationTest(NewIntegrationTestArgs{
Description: "Amends a staged file to a merge commit.",
ExtraCmdArgs: "",
Skip: false,
SetupConfig: func(config *config.AppConfig) {},
SetupRepo: func(shell *Shell) {
shell.
NewBranch("development-branch").
CreateFileAndAdd("initial-file", "content").
Commit("initial commit").
NewBranch("feature-branch"). // it's also checked out automatically
CreateFileAndAdd("new-feature-file", "new content").
Commit("new feature commit").
CheckoutBranch("development-branch").
Merge("feature-branch").
CreateFileAndAdd("post-merge-file", "content")
},
Run: func(shell *Shell, input *Input, assert *Assert, keys config.KeybindingConfig) {
assert.CommitCount(3)
input.SwitchToCommitsWindow()
assert.CurrentViewName("commits")
input.PressKeys(keys.Commits.AmendToCommit)
input.PressKeys(keys.Universal.Return)
assert.MatchHeadCommitMessage(Contains("Merge"))
assert.CommitCount(3)
},
})