mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-12 21:05:48 +02:00
35 lines
954 B
Go
35 lines
954 B
Go
package commit
|
|
|
|
import (
|
|
"github.com/jesseduffield/lazygit/pkg/config"
|
|
. "github.com/jesseduffield/lazygit/pkg/integration/components"
|
|
)
|
|
|
|
var Commit = NewIntegrationTest(NewIntegrationTestArgs{
|
|
Description: "Staging a couple files and committing",
|
|
ExtraCmdArgs: "",
|
|
Skip: false,
|
|
SetupConfig: func(config *config.AppConfig) {},
|
|
SetupRepo: func(shell *Shell) {
|
|
shell.CreateFile("myfile", "myfile content")
|
|
shell.CreateFile("myfile2", "myfile2 content")
|
|
},
|
|
Run: func(shell *Shell, input *Input, keys config.KeybindingConfig) {
|
|
input.Model().CommitCount(0)
|
|
|
|
input.Views().Files().
|
|
IsFocused().
|
|
PressPrimaryAction(). // stage file
|
|
SelectNextItem().
|
|
PressPrimaryAction(). // stage other file
|
|
Press(keys.Files.CommitChanges)
|
|
|
|
commitMessage := "my commit message"
|
|
|
|
input.ExpectCommitMessagePanel().Type(commitMessage).Confirm()
|
|
|
|
input.Model().
|
|
CommitCount(1).
|
|
HeadCommitMessage(Equals(commitMessage))
|
|
},
|
|
})
|