1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-04-19 17:02:18 +03:00
lazygit/pkg/integration/tests/commit/new_branch_with_prefix.go
2024-08-18 10:24:52 +02:00

34 lines
916 B
Go

package commit
import (
"github.com/jesseduffield/lazygit/pkg/config"
. "github.com/jesseduffield/lazygit/pkg/integration/components"
)
var NewBranchWithPrefix = NewIntegrationTest(NewIntegrationTestArgs{
Description: "Creating a new branch from a commit with a default name",
ExtraCmdArgs: []string{},
Skip: false,
SetupConfig: func(cfg *config.AppConfig) {
cfg.GetUserConfig().Git.BranchPrefix = "myprefix/"
},
SetupRepo: func(shell *Shell) {
shell.
EmptyCommit("commit 1")
},
Run: func(t *TestDriver, keys config.KeybindingConfig) {
t.Views().Commits().
Focus().
Lines(
Contains("commit 1").IsSelected(),
).
SelectNextItem().
Press(keys.Universal.New).
Tap(func() {
branchName := "my-branch-name"
t.ExpectPopup().Prompt().Title(Contains("New branch name")).Type(branchName).Confirm()
t.Git().CurrentBranchName("myprefix/" + branchName)
})
},
})