mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-09-10 07:36:27 -04:00
Add test for glob_main_branches
This commit is contained in:
parent
f04b303f58
commit
2e72dcb3a6
41
pkg/integration/tests/branch/glob_main_branches.go
Normal file
41
pkg/integration/tests/branch/glob_main_branches.go
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
package branch
|
||||
|
||||
import (
|
||||
"github.com/jesseduffield/lazygit/pkg/config"
|
||||
. "github.com/jesseduffield/lazygit/pkg/integration/components"
|
||||
)
|
||||
|
||||
var GlobMainBranches = NewIntegrationTest(NewIntegrationTestArgs{
|
||||
Description: "Verify that glob patterns in mainBranches config match correctly",
|
||||
ExtraCmdArgs: []string{},
|
||||
Skip: false,
|
||||
SetupConfig: func(config *config.AppConfig) {
|
||||
config.GetUserConfig().Git.MainBranches = []string{"release/*"}
|
||||
},
|
||||
SetupRepo: func(shell *Shell) {
|
||||
shell.
|
||||
EmptyCommit("initial").
|
||||
NewBranch("release/1").
|
||||
EmptyCommit("release 1 commit").
|
||||
NewBranchFrom("feature", "release/1").
|
||||
EmptyCommit("feature 1").
|
||||
EmptyCommit("feature 2")
|
||||
},
|
||||
Run: func(t *TestDriver, keys config.KeybindingConfig) {
|
||||
t.Views().Commits().
|
||||
Focus().
|
||||
Lines(
|
||||
Contains("feature 2").IsSelected(),
|
||||
Contains("feature 1"),
|
||||
Contains("release 1 commit"),
|
||||
Contains("initial"),
|
||||
).
|
||||
Press(keys.Commits.SelectCommitsOfCurrentBranch).
|
||||
Lines(
|
||||
Contains("feature 2").IsSelected(),
|
||||
Contains("feature 1").IsSelected(),
|
||||
Contains("release 1 commit"),
|
||||
Contains("initial"),
|
||||
)
|
||||
},
|
||||
})
|
||||
|
|
@ -50,6 +50,7 @@ var tests = []*components.IntegrationTest{
|
|||
branch.DeleteRemoteBranchWithDifferentName,
|
||||
branch.DeleteWhileFiltering,
|
||||
branch.DetachedHead,
|
||||
branch.GlobMainBranches,
|
||||
branch.MergeFastForward,
|
||||
branch.MergeNonFastForward,
|
||||
branch.MoveCommitsToNewBranchFromBaseBranch,
|
||||
|
|
|
|||
Loading…
Reference in a new issue