jesseduffield.lazygit/pkg/integration/tests/commit/commit.go
Jesse Duffield 610eddfe05 fix CI
2022-08-13 13:55:09 +10:00

33 lines
888 B
Go

package commit
import (
"github.com/jesseduffield/lazygit/pkg/config"
"github.com/jesseduffield/lazygit/pkg/integration/helpers"
)
var Commit = helpers.NewIntegrationTest(helpers.NewIntegrationTestArgs{
Description: "Staging a couple files and committing",
ExtraCmdArgs: "",
Skip: false,
SetupConfig: func(config *config.AppConfig) {},
SetupRepo: func(shell *helpers.Shell) {
shell.CreateFile("myfile", "myfile content")
shell.CreateFile("myfile2", "myfile2 content")
},
Run: func(shell *helpers.Shell, input *helpers.Input, assert *helpers.Assert, keys config.KeybindingConfig) {
assert.CommitCount(0)
input.Select()
input.NextItem()
input.Select()
input.PressKeys(keys.Files.CommitChanges)
commitMessage := "my commit message"
input.Type(commitMessage)
input.Confirm()
assert.CommitCount(1)
assert.HeadCommitMessage(commitMessage)
},
})