mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-08-09 09:22:48 +03:00
Add initial test for non-matching branch name
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
package commit
|
||||
|
||||
import (
|
||||
"github.com/jesseduffield/lazygit/pkg/config"
|
||||
. "github.com/jesseduffield/lazygit/pkg/integration/components"
|
||||
)
|
||||
|
||||
var CommitWithNonMatchingBranchName = NewIntegrationTest(NewIntegrationTestArgs{
|
||||
Description: "Commit with defined config commitPrefixes",
|
||||
ExtraCmdArgs: []string{},
|
||||
Skip: false,
|
||||
SetupConfig: func(testConfig *config.AppConfig) {
|
||||
testConfig.UserConfig.Git.CommitPrefix = &config.CommitPrefixConfig{
|
||||
Pattern: "^\\w+\\/(\\w+-\\w+).*",
|
||||
Replace: "[$1]: ",
|
||||
}
|
||||
},
|
||||
SetupRepo: func(shell *Shell) {
|
||||
shell.NewBranch("branchnomatch")
|
||||
shell.CreateFile("test-commit-prefix", "This is foo bar")
|
||||
},
|
||||
Run: func(t *TestDriver, keys config.KeybindingConfig) {
|
||||
t.Views().Commits().
|
||||
IsEmpty()
|
||||
|
||||
t.Views().Files().
|
||||
IsFocused().
|
||||
PressPrimaryAction().
|
||||
Press(keys.Files.CommitChanges)
|
||||
|
||||
t.ExpectPopup().CommitMessagePanel().
|
||||
Title(Equals("Commit summary")).
|
||||
/* EXPECTED:
|
||||
InitialText(Equals(""))
|
||||
ACTUAL: */
|
||||
InitialText(Equals("branchnomatch"))
|
||||
},
|
||||
})
|
Reference in New Issue
Block a user