mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-02-03 13:21:56 +02:00
Add integration test for amending from the files panel
This commit is contained in:
parent
c757063264
commit
7513d77567
41
pkg/integration/tests/commit/amend.go
Normal file
41
pkg/integration/tests/commit/amend.go
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
package commit
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/jesseduffield/lazygit/pkg/config"
|
||||||
|
. "github.com/jesseduffield/lazygit/pkg/integration/components"
|
||||||
|
)
|
||||||
|
|
||||||
|
var Amend = NewIntegrationTest(NewIntegrationTestArgs{
|
||||||
|
Description: "Amends the last commit from the files panel",
|
||||||
|
ExtraCmdArgs: "",
|
||||||
|
Skip: false,
|
||||||
|
SetupConfig: func(config *config.AppConfig) {},
|
||||||
|
SetupRepo: func(shell *Shell) {
|
||||||
|
shell.CreateFileAndAdd("myfile", "myfile content\n")
|
||||||
|
shell.Commit("first commit")
|
||||||
|
shell.UpdateFileAndAdd("myfile", "myfile content\nmore content\n")
|
||||||
|
},
|
||||||
|
Run: func(t *TestDriver, keys config.KeybindingConfig) {
|
||||||
|
t.Views().Commits().
|
||||||
|
Lines(
|
||||||
|
Contains("first commit"),
|
||||||
|
)
|
||||||
|
|
||||||
|
t.Views().Files().
|
||||||
|
Focus().
|
||||||
|
Press(keys.Commits.AmendToCommit)
|
||||||
|
|
||||||
|
t.ExpectPopup().Confirmation().Title(
|
||||||
|
Equals("Amend Last Commit")).
|
||||||
|
Content(Contains("Are you sure you want to amend last commit?")).
|
||||||
|
Confirm()
|
||||||
|
|
||||||
|
t.Views().Commits().
|
||||||
|
Focus().
|
||||||
|
Lines(
|
||||||
|
Contains("first commit"),
|
||||||
|
)
|
||||||
|
|
||||||
|
t.Views().Main().Content(Contains("+myfile content").Contains("+more content"))
|
||||||
|
},
|
||||||
|
})
|
@ -44,6 +44,7 @@ var tests = []*components.IntegrationTest{
|
|||||||
branch.Suggestions,
|
branch.Suggestions,
|
||||||
cherry_pick.CherryPick,
|
cherry_pick.CherryPick,
|
||||||
cherry_pick.CherryPickConflicts,
|
cherry_pick.CherryPickConflicts,
|
||||||
|
commit.Amend,
|
||||||
commit.Commit,
|
commit.Commit,
|
||||||
commit.CommitMultiline,
|
commit.CommitMultiline,
|
||||||
commit.CreateTag,
|
commit.CreateTag,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user