mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-08-08 22:36:49 +02: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"))
|
||||||
|
},
|
||||||
|
})
|
@ -80,6 +80,7 @@ var tests = []*components.IntegrationTest{
|
|||||||
commit.CommitSwitchToEditor,
|
commit.CommitSwitchToEditor,
|
||||||
commit.CommitWipWithPrefix,
|
commit.CommitWipWithPrefix,
|
||||||
commit.CommitWithGlobalPrefix,
|
commit.CommitWithGlobalPrefix,
|
||||||
|
commit.CommitWithNonMatchingBranchName,
|
||||||
commit.CommitWithPrefix,
|
commit.CommitWithPrefix,
|
||||||
commit.CreateAmendCommit,
|
commit.CreateAmendCommit,
|
||||||
commit.CreateTag,
|
commit.CreateTag,
|
||||||
|
Reference in New Issue
Block a user